Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LIKE and apostrophe
Message
 
To
26/06/2008 11:38:26
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01326950
Message ID:
01326957
Views:
20
>>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform