Data Cogs Information Technology

posts - 137, comments - 144, trackbacks - 42

There is nothing really adequate on the market to manage version control of your SQL Server tables, views, stored procedures and tables.  A few years ago I wrote a little VB6 app that allows you to compare SQL Server objects with scripts in VSS (as well as perform basic checkin/checkout functionality).  I still find it useful, so I decided to post it in case anyone else can make use of it.  You can download a copy of the VB6 exe here.  In order to view the differences between files, it also requires a DiffMergeCtl.ocx that is installed as part of Visual Interdev 6.0 (and possibly other things)  Below are a few general instructions:

  1. Open up SourceSafe and create a folder structure to hold the scripts for you SQL Server objects.  Something like this:


  2. Open up the Compare Tool application and choose the “Compare SQL Server Version With SourceSafe Version“ button.  Then connect to your SQL Server and your VSS database.
  3. Click the Tables folder in the lower pane that you created in VSS, then click on the Tables folder in SQL Server in the upper pane.
  4. Right click on any item in the list view at the right and chose “Add Folder To SourceSafe“ to check in all the tables in the database to VSS.  Repeat the process for View, Functions and Stored Procedures


  5. After making a change to a stored procedure in Query Analyzer or other editor, start up the compare tool and navigate the top and bottom panes to the appropriate folder (views, tables, etc)
  6. Choose the “Compare Folder“ button.  You should get results similar to this...


  7. If you choose “Show Diff“ you should get a screen similar to this:


  8. If you want to check in the version that is in SQL Server to VSS choose the “Add to VSS“ button.  This will generate a script and check it into VSS.
posted on Wednesday, October 06, 2004 8:54 PM

Feedback

# re: SQL Server Version Control with Visual SourceSafe

This looks like a great utility. Using Microsoft SQL Server 2000 and Visual SourceSafe 6.0d (Build 9848), I'm getting this error when trying to compare files:

"Compare_Tool
"Automation error
"The object invoked has disconnected from its clients.
"[OK]"

Then the app quits. Is there a more recent version of this utility, or a similar utility, that I can use to check for differences between SQL Server and SourceSafe?

Thanks,
Steve
7/31/2008 9:05 AM | Steven Whalen

# re: SQL Server Version Control with Visual SourceSafe

Hi Steve,
Try Redgate SQL Compare Pro,

http://www.red-gate.com/products/SQL_Compare/index.htm

Mark
7/31/2008 9:11 AM | Mark

Post Comment

Title  
Name  
Url
Comment   
Protected by Clearscreen.SharpHIPEnter the code you see: