Compare case now insensitive?
Bernard Sheppard
Posts: 53
I have a table two columns varchar(10):
In Dev, some of the fields are lowercase:
which returns:
The same in SysTest returns nothing - they're upper case.
The previous version of Data Compare always selected these rows as different, but never generated a script to change from upper to lower or vice versa.
It was good that it detected the difference, but not so good that it couldn't script the update.
The current version doesn't detect the difference at all.
CREATE TABLE [tbProfileArea2Lnsp] ( [ProfileArea] [varchar] (10) COLLATE Latin1_General_CI_AS NOT NULL , [LNSP] [varchar] (10) COLLATE Latin1_General_CI_AS NOT NULL , CONSTRAINT [pkProfileArea2Lnsp] PRIMARY KEY CLUSTERED ( [ProfileArea], [LNSP] ) ON [PRIMARY] ) ON [PRIMARY] GO
In Dev, some of the fields are lowercase:
SELECT ProfileArea FROM tbProfileArea2LNSP WHERE ASCII(LEFT(UPPER(ProfileArea), 1)) <> ASCII(LEFT(ProfileArea, 1))
which returns:
citipower ergon1 integral
The same in SysTest returns nothing - they're upper case.
The previous version of Data Compare always selected these rows as different, but never generated a script to change from upper to lower or vice versa.
It was good that it detected the difference, but not so good that it couldn't script the update.
The current version doesn't detect the difference at all.
This discussion has been closed.
Comments
If in one database you have
"Data"
and in the other database
"data"
the two strings are the same according to the collation. If you wish for the data to be compared as different you need to set a case sensitive collation.
Hope this helps.
Richard Mitchell
Project Manager
Red Gate Software Ltd
Hi Richard, that makes sense, and I'm happy with the approach you've taken, and the results that it generates in this scenario - now that I understand it.
We have a few tables where we have things like codes & descriptions. We want to be able to edit a description to cORRECT tHINGS lIKE aCCIDENTAL cAPS lOCK, and have that change detected and propagated - that means we should make those columns Case Sensitive.
of benefit.
There will probably be an option introduced in a future version of the product that will force binary collation comparisons. This will mean that indexes can't be used but at least the result of the comparison will be predictable.
Project Manager
Red Gate Software Ltd