Static Data With No Primary Key

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace, andy.campbell.smith

Static Data With No Primary Key

Postby sburke » Sun May 05, 2013 2:17 am

I am in the process of evaluating the Redgate Development tools, with an initial focus on Source Control and Deployment processes. We use the Wherescape Red Data Warehousing development tool which creates meta data tables in our SQL Server database, with a small number not including primary keys. I would like to capture these in source control as static tables.

I would like to get some guidance on how best to achieve this. Should I create scripts, or is there another aspect of the Redgate software you would suggest?
sburke
 
Posts: 1
Joined: Sun May 05, 2013 2:09 am

Postby james.billings » Tue May 07, 2013 3:22 pm

Thanks for your post.

I'm afraid I'm not familiar at all with the Wherescape tool you mention, although that's probably not too relevant.

To source control data (with SQL Source Control) the data must have a primary key or a unique index. If neither of those are present, then our data comparison engine doesn't know how to evaluate which records should be compared.

The SQL Data Compare tool allows you to configure a "custom comparison key" where you can manually select one or more columns that, in combination, would uniquely identify rows. Unfortunately this functionality isn't in SQL Source Control as it stands.

SQL Data Compare can compare from a database to a set of scripts, so potentially you could sync the DB to some .sql files after configuring a comparison key and then manually source-control those files using something like Tortoise (if using SVN) for example.

Some links that give more detail:

What is a comparison key?

Selecting a comparison key
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 0 guests

cron