Thursday, March 22, 2012

Case Sensitive

I have a table that has a field populated by single character data.
in it 'm' is different than 'M'. How do I differentiate this in my
queries...
It works automatically on my base SQL server, but not on the replicant.
Thanks for the help...Atley,
Please search the SQL Server 2000 Books Online re: "COLLATE" and
"COLLATIONS" to understand why you are getting different results on the
different SQL Server instances.
To help you out immediately, however, the following is an example of how to
use the COLLATE syntax within a SELECT:
create table Atley (c1 char (1) NOT NULL)
go
insert into Atley values ('m')
insert into Atley values ('M')
select *
from Atley
where c1 = 'm' collate Latin1_General_CS_AS
Chief Tenaya
"Atley" <atley_1@.homtmail.com> wrote in message
news:uwl89FFEEHA.3696@.TK2MSFTNGP10.phx.gbl...
> I have a table that has a field populated by single character data.
> in it 'm' is different than 'M'. How do I differentiate this in my
> queries...
> It works automatically on my base SQL server, but not on the replicant.
>
> Thanks for the help...
>
>|||As Tenaya says, this is related to collations. It seems that your collation
on the publisher is case-sensitive and this has replicated to the subscriber
as a case-insensitive collation. Tenaya's query will allow a case-sensitive
comparison to be done on case-insensitive data. However, if you want the
column collation itself to be transferred to the subscriber, so queries
don't need to be modified, then have a look at the article properties,
snapshot tab - there is a checkbox to select the collation there. You'll
need to reinitialize for this to take effect. BTW, the database collation on
the subscriber is the one you're inheriting, so modifying this (ALTER
DATABASE...) and reinitializing would give the same result.
HTH,
Paul Ibison

No comments:

Post a Comment