MS SQL Server dependency scripter


Ever needed to make one large MSSQL script file containing changes you made from last version of your software? I was doing it all the time.

So I decided to write a tool that will make that process easier for me. MS SQL Dependency scripter (mssds) can make large scripts from given list of objects (functions or storred procedures) that are in SVN diff file, plain text file or you can specify a date.

Examples of use:

  1. -d switch script newer than given date:

    mssds.exe -d 2011-02-20 -s <put your sql server here> -n <put name of databese here>

    Program will output generated script to console. If you want to put script to a file, you should use -o switch:

    mssds.exe -d 2011-02-20 -s <put your sql server here> -n <put name of databese here> -o "c:\script.sql"

  2. -i switch object from SVN input file:

    If you use subversion for keeping changes in your SQL scripts, then you can use -i switch to specify input file generated by svn diff -r {2009-08-07}:HEAD --summarize command. This will create list of files that were changed after specidied date.

    mssds.exe -i list.txt -s <put your sql server here> -n <put name of databese here> -o "c:\script.sql"

    Example of SVN list.txt input file:

    A   proc1.sql
    A   proc2.sql
    A   func1.sql
    M   proc3.sql
    M   func3.sql

  3. -l switch object from plain text file

    Very similar then SVN but in this case input file can be generated by hand or using dir /b /s *.sql command.

    mssds.exe -l list.txt -s <put your sql server here> -n <put name of databese here> -o "c:\script.sql"

    Example of list.txt input file:

    proc1.sql
    proc2.sql
    func1.sql
If you like this program or if you are using it, please consider a donation to support my work.


If you don't like to donate, you can simply click any of the adds on this page to support my work.
ċ
mssds.zip
(435k)
Simon Šander,
25 Mar 2013, 00:20
Comments