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 2000 Forums
 SQL Server Development (2000)
 Case Sensitive

Author  Topic 

tmcheah
Starting Member

2 Posts

Posted - 2004-09-24 : 22:45:52
Dear Derrick,

I had encountered the problem as below.

When I want to save the 2 records with code 'BA' and 'Ba'. It is no problem. But when I want to delete only code 'Ba'. It delete the both records. How can I prevent this problem. How to set the case sensitive.

Will much appreciate if you can give me the answer.


From Angie Ng

kselvia
Aged Yak Warrior

526 Posts

Posted - 2004-09-24 : 23:34:30
This will force case sensitive comparision.

delete from MyTable where MyCol COLLATE Latin1_General_BIN = 'Ba'


--Ken
I want to die in my sleep like my grandfather, not screaming in terror like his passengers.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-09-25 : 15:31:24
You can also use convert(varbinary(), ...) on both sides.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-09-25 : 20:05:21
Either way is going to cause a recompile. If you want to always treat this one column as case-sensitive, you should alter the column to use a case sensitive collation so you aren't getting recompiles all the time. Look at the COLLATE clause.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -