Mapping owners
Published 23 January 2013
When you set up a project and you select your data sources, SQL Data Compare automatically maps objects with the same name and the same owner (SQL Server 2000) or schema (SQL Server 2008 and SQL Server 2005) 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, this enables SQL Compare to 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 is not mapped are not 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 do not 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.
The Owner Mapping tab allows you 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 are not 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.