dbTalk Databases Forums  

Need to create case sensitive Uniqiue Indexes

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Need to create case sensitive Uniqiue Indexes in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Thorpe
 
Posts: n/a

Default Need to create case sensitive Uniqiue Indexes - 08-07-2003 , 06:34 AM






Hi,

How Can I create a case sensitive unique index so that A1 and a1 are treated
as different ?

I dont mind if I have to make a global DB change.

Steve



Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Need to create case sensitive Uniqiue Indexes - 08-07-2003 , 05:16 PM






Steve Thorpe (stephenthorpe (AT) nospam (DOT) hotmail.com) writes:
Quote:
How Can I create a case sensitive unique index so that A1 and a1 are
treated as different ?

I dont mind if I have to make a global DB change.
You should change the database to use a case-sensitive collation - and
maybe the entire server, since collation mix on the same server can
cause problems with tempdb.

You can achieve this in several ways. You can bulk out all data and
build a new database from scripts where you have changed the collation
and then bulk data back. You can also issue ALTER TABLE ALTER COLUMN
for all columns with character data. You also need to use ALTER COLLATION
SET COLLATION. (This latter command sets the default for future columns,
but does not affect existing ones.)

To change the collation for master, you use the rebuildm facility.

--
Erland Sommarskog, SQL Server MVP, sommar (AT) algonet (DOT) se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.