Red Gate forums :: View topic - compare and then update table row values
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

compare and then update table row values

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



Joined: 15 Aug 2013
Posts: 1

PostPosted: Thu Aug 15, 2013 6:48 pm    Post subject: compare and then update table row values Reply with quote

I have gotten Data Compare to open up my two databases and show me the differences between two databases but I want to do some more complex things with my data once I find differences and I'm not sure if this tool can do it.

Currently:
1 db in dev
1 db in prod

I want to be able to:

1)Compare all processes, templates, roles, and products for date/time differences between the Development and Production databases
2)If there is a difference, update the version number of the process
3)Change the last edited by to pdsysadmin
4)If there is no difference, then it does nothing to the process/product/templates/roles page

Explanation:

I want to compare the development and prod database and find anywhere where the last edited dates don't match (the system will update the last edited date but not the version).

For the differences that Data Compare finds I want to have the Production db version number field and the date/time field updated to match the Development database values. If the last modified dates on both db's match it means that nothing was touched and that row does not need to be modified.

Has anyone used Data Compare to do anything like this?

Thanks,

Daniel
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Fri Aug 16, 2013 9:35 am    Post subject: Reply with quote

Thanks for your post.

It sounds like you should be able to do what you need.

1. Go to the 'Tables & Views' tab, and only select: processes, templates, roles, and products
2. For each of the tables/views you're comparing, set a WHERE clause to match on any rows where the update dates don't match.
3. When you sync' make sure you use the pdsysadmin account, so that is the account used to update the target. that is assuming the last edited field is populated by the user account.

If this doesn't help, you could probably get most of the way there using this method, and then just output the deployment script and edit it to fit your requirements.

I hope this helps.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
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