free utility to script DB objects in ms sql
sql-server, svn, version-control
Solution
I use ScriptDB for exactly this purpose. The only thing I had to change was to remove the date of scripting in the generated files. Otherwise files are always marked as changed in Subversion.
Here is the batch I use. svnclient is the tool from codeplex svncompletesync.codeplex.com, to check in all files from a folder into subversion.:
`svn checkout "http://svn/myproject" D:\Projekte\db_svn\myproject`
`ScriptDB "D:\temp\scriptdb" myserver mydb mylogin mypwd`
`del "D:\Projekte\db_svn\myproject\Schema Objects\\*.sql" /q /s`
`xcopy "D:\temp\scriptdb\myserver\mydb\Schema Objects\\*.sql" "D:\Projekte\db_svn\myproject\Schema Objects" /e /y /i`
`svnclient "D:\Projekte\db_svn\myproject" -m "commit durch svncompletesync"`
Problem
I'm trying to implement database source control. the tool I need should create a separate file for each object in the database, preferably arranged in folders, like stored procedures functions views tables and it would be great being able to also dump the results of certain queries, in order to keep track of the data changes in several configuration tables... I wonder if there's is already a tool that can handle this kind of stuff... -- just to clear a few things... I'm already using sql delta to handle the update scripts... I'd like to have scripts of the DB in order to use with subversion, so I can trace what objects where changed with each commit, without having to study the update scripts... I'm developing a nice vb script with SQL Distributed Management Objects (SQL-DMO), I'll tell how it goes... What's good about having my own solution, is that I can also include the outputs of queries or stored procedure execution, to trace the changes in certain tables, server configuration, the growth of the database, well, whatever I can dump to a text file...