Red Gate forums :: View topic - Version control of data
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare 10
SQL Data Compare 10 forum

Version control of data

Search in SQL Data Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
msollicito



Joined: 07 Nov 2012
Posts: 5
Location: Marietta, GA 30067

PostPosted: Wed Nov 07, 2012 4:17 pm    Post subject: Version control of data Reply with quote

I am trying to decide the best way to version control the DATA in our databases. However, the primary keys / foreign keys will be different in our Staging Database to our Production Database, but I am assuming that is pretty common?

Can SQL DATA Compare handle that? I want to be able to select which data in the Staging database should be copied to Production, but in Production the keys will be different to those in Staging (auto generated identity type keys) because we have some test ids in Staging, etc.

That should work fine in SQL DATA Compare right?
_________________
Contact me on:
Email /Yahoo! Messenger michelle.sollicito@yahoo.com
GoogleTalk/MSN michelle.sollicito@gmail.com
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
james.billings



Joined: 16 Jun 2010
Posts: 1121
Location: My desk.

PostPosted: Wed Nov 07, 2012 7:24 pm    Post subject: Reply with quote

Hi,

SQL Data Compare requires a comparison key to know which records should relate to each other. By default, the tool will use the PK for this.

If you have databases where the PK's are different for what is essentially the same data (for instance a record for customer "Joe Bloggs", with ID 100 in Staging but 552 in Production) then SQL Data Compare will see these as unrelated records, and will either add (or update if it's already there) record 100 in the target production DB.

The only way you could map changes from record 100 in the source to, say, 552 (and these are actually the "same" data) would be to specify some other comparison key. See http://www.red-gate.com/supportcenter/Content/SQL_Data_Compare/help/10.0/9067 and http://www.red-gate.com/supportcenter/Content/SQL_Data_Compare/help/10.0/SDC_SelectingObjects#o7591
Back to top
View user's profile Send private message
msollicito



Joined: 07 Nov 2012
Posts: 5
Location: Marietta, GA 30067

PostPosted: Thu Nov 08, 2012 1:31 am    Post subject: Thanks.. Reply with quote

So I am guessing that if some other column or combination of columns is also unique, we could use that.. right?
I am pretty sure it must be but I will check with my client!
_________________
Contact me on:
Email /Yahoo! Messenger michelle.sollicito@yahoo.com
GoogleTalk/MSN michelle.sollicito@gmail.com
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
james.billings



Joined: 16 Jun 2010
Posts: 1121
Location: My desk.

PostPosted: Thu Nov 08, 2012 1:32 pm    Post subject: Reply with quote

Yeah- if you have some other column which would match up the same record in different DBs, you can use that (so you may have an Identity column for the PK which differs, but also a "CustomerNumber" column which would be consistent; so you can set that instead.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group