Data Compare using an index when no index is present
ben_leah
Posts: 12 Bronze 2
OK, I have two tables that do not have any indexes on them, when i create the matching columns i do the following
This works fine, but any Update SQL is always keyed on all of the fields in the table (non unique index). How can i specify that the Update SQL should just be keyed on the field mappings (MeasureId, ApplicationCode)??
TableMapping tableMapping = (TableMapping)mappings.Join(oldDatabase.Tables["[dbo].[W_CO_Measure_Definition]"], newDatabase.Tables["[dbo].[W_CO_Measure_Definition]"]); tableMapping.MatchingMappings.Clear(); tableMapping.MatchingMappings.Add(tableMapping.FieldMappings["MeasureID"]); tableMapping.MatchingMappings.Add(tableMapping.FieldMappings["ApplicationCode"]); tableMapping.RefreshMappingStatus();
This works fine, but any Update SQL is always keyed on all of the fields in the table (non unique index). How can i specify that the Update SQL should just be keyed on the field mappings (MeasureId, ApplicationCode)??
Comments
What I want is :
Your code certainly looks like it would give you the result you are looking for. The SQL code that's output looks like it is using a comparison key that combines 19 columns.
Is it possible that the session object you are using as an argument in the GetMigrationSql method is using a diferent session than the one you are applying these mappings to?