Share via


SQL Server Data Compare doesn't retrieve table list

Question

Monday, March 2, 2015 9:41 PM

I'm trying to do a data compare in Visual Studio 2013.  I have chosen my source and targets and successfully tested the connection to each of them in the connections dialog. 

When I choose next, there's a few seconds delay as though the compare tool is checking with the source and target and then it shows a dialog with what to compare.  There is a checkbox next to Tables and next to Views.  Those are the only two options shown. 

What should be in this dialog, left of Tables and Views, is an arrow to expand them and show the list of tables and views in the source database.  The arrow is missing and I cannot expand any list of tables or views.  There's just nothing shown to compare.

When I click Next again, the compare appears to run but when complete it reports that zero tables or views were compared - under the circumstances this is as expected because the previous dialog did not allow me to check any tables to compare.

Why am I not getting the arrow to expand the list of tables?  What's wrong with Data Compare?

Thanks,

Dale

All replies (6)

Tuesday, March 3, 2015 3:30 PM ✅Answered | 1 vote

I may have solved the problem - at least I got my compare done - but I don't understand the solution.  In your image you show a primary key value in comparison key but my tables did not have a primary key assigned - they were simply working tables for generating the script and will be discarded as soon as the script is generated.

The original data compare tool in VS2005 and beyond did not require a "comparison key".  This requirement makes no sense.  Either every row on one DB matches a row on the other DB or it does not.  Having or not having a primary key is a schema difference not a data difference. 

Is the comparison key requirement by design?  If so, then when a compare fails due to the lack of a comparison key there should be some message or indication rather than failing silently with no feedback to the user.


Wednesday, March 4, 2015 3:36 AM ✅Answered

Hi Dale,

>>In your image you show a primary key value in comparison key but my tables did not have a primary key assigned

>>Is the comparison key requirement by design? 

I repro it, I get the same issue as yours, if no key, we couldn't compare the tables.

Like the document here:

https://msdn.microsoft.com/en-us/library/dn266029%28v=vs.103%29.aspx?f=255&MSPPError=-2147217396

https://msdn.microsoft.com/en-us/library/aa833428(v=vs.100).aspx

Requirements

When you compare data in a table or view, the table or view in the source database must share several attributes with a table or view in the target database. Tables and views that do not meet the following criteria are not compared and do not appear on the second page of the      New Data Comparison   wizard:

  • Tables must have matching column names that have compatible data types.

    Names of tables, views, and owners are case-sensitive.

  • Tables must have the same primary key, unique index, or unique constraint.

  • Views must have the same unique, clustered index.

  • You can compare a table with a view only if they have the same name.

Each object has a key or an index that determines the other objects to which it corresponds. However, each table or view can have more than one primary key, unique index, or unique constraint. Therefore, you might want to specify which key, index, or constraint to use.

As my understanding, it would have the specific requirements.

Best Regards,

Jack

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.


Tuesday, March 3, 2015 8:35 AM | 1 vote

Hi Dale,

I repro this issue in my side, I think the real issue is that when we could use the "New Data Comparison".

Like the following screen shot.

To really use this feature, firstly we have to make sure that two tables have the same names in different database, in addition, they have the same properties like A in every table. I think you could test it in your side.

Best Regards,

Jack

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.


Tuesday, March 3, 2015 3:15 PM

Jack,

I created a new database as source and then created the source table.  I added some data to the source table.  Then I created a second new database as target.  I scripted the source table as CREATE and executed that script on the target DB. 

Now I have two exact databases and tables except source has data and target has none.  Then I try to run the data compare.  My goal is to create a difference script from the compare that will INSERT the data into another database later. 

When I run the compare, I get the results I described: 0 tables or views are compared.

Thanks,

Dale


Wednesday, March 4, 2015 2:22 PM

Thanks, Jack.

Is there a Connect site for Visual Studio 2013?  It's one thing to have the requirement in documentation that may or may not (did not for me) come up in an Internet search but there should have been some feedback in the app that the reason there were no tables to search was no primary key.  The primary key requirement didn't exist in the Red-Gate based version of Database Professional first embedded in Visual Studio.


Thursday, March 5, 2015 1:39 AM

Hi Dale,

The connect site:http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

Best Regards,

Jack

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.