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:
01326958
Views:
16
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform