views:

409

answers:

3

I have all my SQL stored in source control in the following structure

Database
    Tables
    Stored Procs
    Views
    Static Data

I'd like to tie my source control into SSMS, which seemingly supports source control, but SSMS wants to put all the scripts into one folder, which is a non-starter for me.

Is it possible to get SSMS to work my existing structure? If not, is SSMS 2008 a bit more flexible in that respect?

+1  A: 

You could use SQLDMO (obsolete) to script them out or SMO to do it. Or a third party tool like Apex SQL Script with some automation.

Cade Roux
+1  A: 

You could use a Visual Studio Database Project instead (included with VS 2005 Professional). It offers all of the nice project features of Visual Studio, including subfolders! But its not as easy to run sql scripts. You have to save the file, then right click and select Run Script. Your results will show up in the output window. Its not quite as easy as F5 in SSMS, and you don't get the tabular result option.

There is a nice overview at http://blog.reamped.net/post/2008/05/Using-Database-Projects-for-Visual-Studio.aspx.

jrummell
+1  A: 

Red Gate will be releasing a new SSMS add-in tool called SQL Source Control. This links your development database with a location in source control so you won't need to manage the scripts yourself - you simply modify the objects in your development database and the tool does the rest. To find out more and to sign up to the early access program please visit this link.

David Atkinson
This sounds so very promising.
Chris Lively
Just to let you know that this has now been shipped. Please try it at http://www.red-gate.com/products/SQL_Source_Control/index.htm
David Atkinson