Contributor: JonRanes

Why You Should Be Using Source Safe Integration For Ad-Hoc Queries in MSSQL

When I first saw that MSSql 2008 offered source safe integration I soon realized that this did not mean I would be able to check stored procedures in and out from the Management Studio and decided to not bother with it.  Lately though after moving some things around and making room on my hard drive I accidentally deleted a script that turned out to be very important.  The script converted my production database to development mode and removed all the production settings that made things like live payments against customers accounts instead of test ones.

You can probably guess what happened, I rewrote the script from memory and yes I forgot to include a very important conversion that made me end up charging a customer with test transactions, OOPS!

So now I am a source safe with Management Studio true believer, and it turns out it is an awesome feature after all that works really well.  Who knew!  So if you ever wondered what all that MSSql project and solution dialogue was about the twenty cent quick less on it is that a SQL solution is basically something that holds SQL projects, no brainer.  SQL projects are basically just something you make up like "MyScripts" or you could have a DevScripts and a ProdScripts project.  But on the right side of management studio under the project you can add your ad-hoc scripts to the project.  And guess what?  You can check them in and out with the usual right click menu you are used to in visual studio.  So now I will not only NOT loose my scripts I even have versions of them stored where something I may need from the past is just waiting for me there in the view history dialogue.  Why did it take me so long to learn?

All you need to know is make a project and solution, add the solution to source safe, click new query, then from File->Move (new query) to ->ProjectName and you are done!

image_2

Comments refreshcmnts
(gravatar only)
Edit Comment

Please wait... loading

Reply To Comment

Please wait... loading