SQl Compare - Shows identical Objects as Different

KRUserKRUser Posts: 3
edited June 1, 2011 1:50PM in SQL Compare Previous Versions
Hello,

I am using SQL Compare 8 to compare 2 SQL server 2008 databases hosted on different servers.
I think SQL Compare is picking up trailing whitespaces in the column names as differences. Is there anyway to avoid this? I came across this Link where it mentions about a 'Ignore spaces in object names" setting in the Project oprions menu. But I don't see any such option when I look in Project options.
As of now, I have the 'Red Gate defaults' enabled.

Below are the scipts for the same table on DB1 and DB2
DB1
CREATE TABLE [dbo].[XYZTable]
(
[CUST-ID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FIRST-NAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MIDDLE-NAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LAST-NAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NAME-SUFFIX] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TITLE] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LICENSED-IND] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PROF-TYPE] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EMAIL-ADDR] [nvarchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
)
GO

Database 2
CREATE TABLE [dbo].[XYZTable]
(
[CUST-ID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FIRST-NAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MIDDLE-NAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LAST-NAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NAME-SUFFIX] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TITLE] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LICENSED-IND] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PROF-TYPE] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EMAIL-ADDR                                                                                                                  ] [nvarchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
)

Any help is appreciated, Thanks!

Comments

  • Thanks for your post.

    I don't believe there is any way to ignore the trailing spaces in object names. A space is considered a valid character in an object name, so the objects with the trailing spaces are considered different objects.

    The 'ignore whitespace' option is more for the syntax used in object definitions, not the actual object names.

    The option to 'ignore spaces in object names' is actually a SQL Data Compare option, not a SQL Compare option.

    It's slightly harder to map differently named objects together in SQL Compare, as you also have to take into account all the dependant objects and map them accordingly too.

    I hope this helps explain.
    Chris
  • Thanks for the reply Chris.
    I was really hoping there was a way to do that especially since adeptsql by default ignores those spaces.
Sign In or Register to comment.