Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Case Sensitivity

Author  Topic 

notmyrealname

98 Posts

Posted - 2009-06-04 : 20:14:47
Hi.

I have a table like:

Workorder Drawing Part Etc...
--------- ------- ---- ------

My primary key includes Workorder, Drawing, Part.

I have a primary key conflict with two records that are the same except for case as shown below.

Workorder Drawing Part
--------- ------- ----
182001 S1 S1
182001 S1 s1

My insert does not allow this because it thinks the record already exists. Is there a way to include case sensitivity in my primary key, or table properties, or database properties, or somewhere else?

Thanks.

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2009-06-04 : 21:42:29
You can store the key as a binary, but I would actually think of possibly using a differant primary key value for your tables.


Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881
Go to Top of Page

kunal.mehta
Yak Posting Veteran

83 Posts

Posted - 2009-06-04 : 23:59:47
Hi,
try to change the collation of your column

ALTER TABLE Table1
ALTER COLUMN Column1 VARCHAR(20)
COLLATE Latin1_General_CS_AS

Kunal
Go to Top of Page
   

- Advertisement -