Mapping owners
Published 05 June 2013
When you set up a project and you select your data sources, SQL Data Compare automatically maps objects with the same schema for you.
If you want to compare objects with the same name, but those objects have different owners or belong to different schemas, you can map the owners or schemas as required. For example, if you want to compare objects in a test database that are owned by sales with objects in a production database that are owned by support, you can map sales to support.
For example, if you map the owners (or schemas) sales and support, SQL Data Compare can compare the stored procedures [sales].[editCustomerDetails] and [support].[editCustomerDetails].
SQL Data Compare can then rename other objects that are referenced by the stored procedure. For example, if the [support].[editCustomerDetails] stored procedure references the table [support].[customerDetails], the stored procedure is updated to reference the table [sales].[customerDetails]. The same applies to functions, DML triggers, DDL triggers, views, defaults, and rules.
Tables in a schema that isn't mapped aren't compared. For example, if you unmap the schemas Sales and Support, and then map Support to Sales, the comparison will fail for all tables owned by Sales if you don't also map Sales to another schema.
Editing the owner mappings
To display the Owner Mapping tab, on the Project Configuration dialog box click Owner Mapping.
You use the Owner Mapping tab to map different owners (schemas).
The upper pane displays a list of schemas, database roles, and database users that SQL Data Compare has automatically mapped for you; the lower pane displays a list of schemas, database roles, and database users that aren't mapped.
- To undo a mapping, in the upper pane, select the mapping, and click Unmap
- To create a mapping, in the lower pane, select an owner from the source, then select a corresponding owner from the target, and click Map.
For example, to map sales to support, you create a mapping for sales to support and then you create a mapping for support to sales.
To reset the mappings to the defaults, click Restore Default Mappings.