Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LIKE and apostrophe
Message
 
 
À
26/06/2008 11:38:26
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01326950
Message ID:
01326958
Vues:
17
>>>This doesn't work for obvious reasons. I'm trying to find all records that have an apostrophe in the DocumentName field.
>>>
>>>WHERE H.DocumentName LIKE '%'%'
>>>
>>
>>Just double it:
>>
>>WHERE H.DocumentName LIKE '%''%'
>>
>
>I'm sure it works, but what is the logic with that? That makes no sense to me at all.

In SQL Server you should always escape single quote, so you must double it. You can also try to use different string delimiters than single quote, but then you should turn on some flag.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform