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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-02-10 : 19:43:55
|
| MarkW writes "Will SQL Server 7.0 consider the key value 007BOND to be a different and therefore unique key from 007Bond ? What would be the best datatype to use when storing such a value (the real key has 15 characters). I have searched and searched but in vain for an answer, regs Mark." |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-02-10 : 20:29:51
|
HiYou could convert your data to varbinary and store it as that, then convert back to varchar when you want to read it. Or use varbinary just for the comparison i.e.declare @key1 varchar(15)Select @key1 = '007Bond'declare @key2 varchar(15)Select @key2 = '007BOND'Select Case WHEN cast(@key1 as varbinary(15)) = cast(@key2 as varbinary(15)) THEN 1 ELSE 0 END as DoesMatch Damian |
 |
|
|
Nazim
A custom title
1408 Posts |
|
|
|
|
|