November 9, 2010 at 9:20 pm
Comments posted to this topic are about the item SQL Server Central Webinar Series #5: Setup Your Source Control With Help from PowerShell
December 13, 2010 at 8:50 am
Keep in mind Red Gate has a wonderful tool, Sql Compare and if you have the professional edition it comes with a command-line utility, sqlcompare.exe (I'm not sure why you use SQL Source Control without it!).
Anyways here's one-liner to script out all of your database objects (one file per object) with a folder structure of Tables, Stored Procedures, Views--i.e. the kind of structure you'd expect to check into source control:
sqlcompare.exe /s1 "MyServer" /db1 "MyDb" /mkscr:"C:\Scripts"
I'm a big PowerShell fan, but sometimes it just makes sense to purchase/use an existing tool. You can always wrap PowerShell scripts around the tool as needed.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy