Red Gate forums :: View topic - Unable to run diff on extracted tables
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

Unable to run diff on extracted tables

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
SQLAdminCJ



Joined: 28 Dec 2011
Posts: 10

PostPosted: Thu Aug 30, 2012 7:33 am    Post subject: Unable to run diff on extracted tables Reply with quote

Hey all,

I am trying to troubleshoot an exception that the data diff program that I wrote has been giving me.Hey all,

I am trying to troubleshoot an exception that the data diff program that I wrote has been giving me on a client's server. Their database is very large, and the error is caused during the process of running the commands to sync a specific table. There is a slightly different version of the database on each of 2 servers.

Rather than bring all of both databases back to my dev environment, I decided to create a new database on each server, and copy only the specific table into the new database using select into.

Since there were 2 servers, this means I had two of these databases containing only this one table. I brought them back to the office and ran my utility, but the table differences are coming back null even though at the client site itself it shows many differences.

Does anyone have any idea of what could be going on? What am I not transferring when copying the table using select into that is necessary to diff the two tables? I would appreciate any advice that anyone can provide. Thanks.
Back to top
View user's profile Send private message
SQLAdminCJ



Joined: 28 Dec 2011
Posts: 10

PostPosted: Fri Aug 31, 2012 12:37 am    Post subject: Found out what happened Reply with quote

Hey all,

I found out why the diff wasn't working when the tables was copied via this method; the primary key on the table is not preserved.

This leads to the question: is there a way to copy the tables I want to compare to a new database? Ideally, I could do this relatively easily using the GUI as opposed to bulk copy. Or, I suppose I could set the primary keys on the tables manually.

Let me know if you have any ideas. Thanks.
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 31, 2012 1:50 pm    Post subject: Reply with quote

Thanks for your post.

When you do a select into, I think it only adds the basic column structure and doesn't add any other structural information like indexes, permissions etc. If you want to copy the complete structure of the table you could use the SQL Compare API to deploy the table to the target database. After you have deployed the structure of the table you can use the SQL Data Compare API for the data. The SQL Compare / SQL Data Compare UI or command line might be useful for this if you don't need to include it in your own application.

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