Options

Comparison key for empty tables

vikaskvikask Posts: 2
If some table is empty in both databases, there should not be any need to define a comparison key. At least there should be some indication that table is empty on both side.

Regards
Vikas

Comments

  • Options
    Eddie DEddie D Posts: 1,780 Rose Gold 5
    Thank you for your post into the forum.

    For SQL Data Compare to match rows of data between two data sources requires a comparison key for each table or view to be compared.

    SQL Data compare will automatically select a comparison key, if your tables contain a matching primary key, unique index or unique constraint and the views, contain a matching unique clusterd index.

    If SQL Data Compare is unable to select a comparison key, you need to set a comparison key manually by editing the Project Configuration ->Tables & Views Tab.

    Using your example of an empty or blank table or view in both databases. After performing a comparison, if a comparison key is selected, the results panel will list the table or in the section "#N tables or views with identical rows only", where #N = the number of objects listed.

    You can then select the object and the 'Row Differences' below the results panel will show no data.

    If a comparison key is not selected, the table or view will be listed in the "#N tables or views that could not be compared", where #N = the number of objects listed. You must then manually select a comparison key so that SQL Data Compare can compare the table.

    Therefore for SQL Data Compare to be able to confirm for this table in (using your example) each data source, that there are zero rows of data, it requires that a comparison key be set.

    I hope the above explains the comparison process. Further information can be found in the SQL Data Compare help file ->Setting Up the Comparison ->Selecting Tables and Views ->Scroll down the page to the 'Selecting the comparison key' section.

    Many Thanks
    Eddie

    Eddie Davis
    Product Support Engineer
    Red Gate Software Ltd
    E-Mail: support@red-gate.com
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.