Why Are Schemas Flagged As Diff When Owners are Mapped?

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Why Are Schemas Flagged As Diff When Owners are Mapped?

Postby SteveT » Fri Jun 27, 2014 9:32 pm

I'm using SQL Compare V10 to compare tables between a Production and QA database. In this situation, the Prod and QA databases use the same table objects, however they are owned by a different schema:
Example: In Prod we have PROD.TABLE1, in QA we have QA.TABLE1

I have mapped owners PROD to QA so they are treated as equivalent, however these names are flagged as differences in the output/report.

I understand that they are different due to different names, but I though that was the whole purpose of mapping owners(schemas) ?

I could not find an option work around this, any ideas?
SteveT
 
Posts: 2
Joined: Fri Jun 27, 2014 9:19 pm

Postby Admin » Mon Jun 30, 2014 2:08 pm

I could not reproduce your issue in SQL Compare version 10.7. Creating the database as below and then mapping SCHEMAA to SCHEMAB and vice-versa creates a comparison where SCHEMAA.Table1 is compared to SCHEMAB.Table1 and vice-versa.

The only thing I noticed is that if the tables are different for a reason other than the table name, the SQL view highlights the name as a difference. So for example the code below creates a system-generated primary key and that is the reason they show up in the different objects list of the results. If you then use the option to ignore the names on constraints, then the tables are shown as equal.

It's the SQL view windows that are broken, but this does not affect the actual result.

If this is your issue, please let me know.
Code: Select all
CREATE SCHEMA SchemaA AUTHORIZATION dbo;
GO
CREATE SCHEMA SchemaB AUTHORIZATION dbo;
GO
CREATE TABLE SchemaA.Table1(
ID int PRIMARY KEY,
DATA nvarchar(50)
)
GO
CREATE TABLE SchemaB.Table1(
ID int PRIMARY KEY,
DATA nvarchar(50)
)
GO
Admin
Site Admin
 
Posts: 9
Joined: Sun Aug 15, 2004 10:44 am

Postby SteveT » Tue Jul 01, 2014 7:32 pm

After careful examination, I found that you are correct. The only tables listed are the ones that actually have a difference. The part that bothers me is that the table and index scripting highlights the fully qualified table name as a difference. When I check off "Ignore Constraint and Index Names", it does not stop the highlighting of the fully-qualified table names in the report; I wish I could achieve that to avoid confusion for the folks I will forward the report to.
SteveT
 
Posts: 2
Joined: Fri Jun 27, 2014 9:19 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests