I\'m trying to insert
some text data into a table in SQL Server
9.
The text includes a single quote(\').
How do I escape that?
2 ways to work around this:
for '
you can simply double it in the string, e.g.
select 'I''m happpy'
-- will get: I'm happy
For any charactor you are not sure of: in sql server you can get any char's unicode by select unicode(':')
(you keep the number)
So this case you can also select 'I'+nchar(39)+'m happpy'