Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Case Sensitive comparison, simple one!
Message
De
27/01/2006 14:18:06
 
 
À
27/01/2006 13:55:04
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00637469
Message ID:
01091060
Vues:
17
>
>You can do that by converting string values to binary
>IF CAST( 'ALLO' AS varbinary(10)) = CAST( 'Allo' AS varbinary(10))
> PRINT '=='
>ELSE
> PRINT '<>'
>

>
>Sergey, you provided that answer a few years ago and it helped some one. I was trying to figure out the same thing today, and figured a "Sergey Search" would give me the answer.
>
>You are THE MAN!
>
>Kevin

SORRY,

The conversion to varbinary is wrong.
IF 'ALLO' = 'ALLO '
SELECT 'same'
ELSE
SELECT 'diff'

IF CAST( 'ALLO' AS varbinary(10)) = CAST( 'ALLO ' AS varbinary(10))
SELECT 'same'
ELSE
SELECT 'diff'
use COLLATE
IF 'ALLO' = 'allo ' COLLATE Latin1_General_BIN
SELECT 'same'
ELSE
SELECT 'diff'
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform