4

Is there a way to have Visual Studio 2010 save the SQL you've developed in the SQL Editor to the current solution?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Matthew Crews
  • 4,105
  • 7
  • 33
  • 57
  • As some text file in the solution I'm guessing or a stored procedure. I'm not sure what is available which is why I'm venturing the question. – Matthew Crews Aug 03 '10 at 22:09
  • 1
    Have a look here: http://stackoverflow.com/questions/146543/what-is-the-best-way-to-version-control-my-sql-server-stored-procedures – Robert Harvey Aug 03 '10 at 22:41

1 Answers1

0

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.

You can add a sql file to any project though - there is no out of the box template for them though. 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 :-(

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.

Mesh
  • 6,262
  • 5
  • 34
  • 53