简体   繁体   English

在Visual Studio 2010中保存SQL

[英]Saving SQL in Visual Studio 2010

有没有办法让Visual Studio 2010将您在SQL编辑器中开发的SQL保存到当前解决方案中?

If you create a query via the "Server Explorer" you wont be able to save it. 如果您通过“服务器资源管理器”创建查询,则无法保存它。 You have to copy the SQL to a file and save it. 您必须将SQL复制到文件并保存。

You can add a sql file to any project though - there is no out of the box template for them though. 您可以将sql文件添加到任何项目中 - 尽管它们没有开箱即用的模板。 So either create a template yourself, or just add a text file and change the extension to .sql - you get syntax highlighting etc but you don't get the 'visual' designer, you'll have to paste your code into a sever explorer, new query :-( 所以要么自己创建一个模板,要么只是添加一个文本文件并将扩展名更改为.sql - 你会得到语法突出显示等但你没有得到'视觉'设计师,你必须将你的代码粘贴到一个服务器资源管理器中,新查询:-(

To me there seem to be quite a few issues with what they've tried to do with DBs and Visual Studio 2010. The Database Project is way way over the top for most SQL work. 对我来说,他们尝试用DBs和Visual Studio 2010做的事情似乎有很多问题。对于大多数SQL工作来说,数据库项目是最重要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM