Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LIKE and apostrophe
Message
De
26/06/2008 11:44:12
 
 
À
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:
01326957
Vues:
21
>>>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.

Usually single apostrophe is used as a string terminators (I am not sure about if that term is right). So how to use apostrophe inside the string? There must be a way to let T-SQL know that this apostrophe is not a terminator but a regular char. MS decides to use double apostrophes for that.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform