Changing Case Sensitivity
Leslie,
See this sample..
set nocount on
create table casesent
(
ide int identity(1,1),
nme varchar(20)
)
Go
--since we didnt mention any collation, it will take the default.
--To find what collation the table was created, do
sp_help casesent --SQL_Latin1_General_CP1_CI_AS
Go
--Run the below query to find out the collations
--which are case-sensitive
select * from ::fn_helpcollations()
where [description] like '%case-sensitive%'
--I selected a random one.Now changing the collation for nme column
--to be case sensitive
alter table casesent
alter column nme varchar(20) collate SQL_Latin1_General_CP1_CS_AS
Go
--Checking if it works
insert casesent values('leslie')
Go
select * from casesent where nme='Leslie'
Go
No rows as output.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
|