SQL literal escape character

2b77bee6-5445-4c77-b1eb-4df3e5

What is the escape character for MS-SQL-Server

WHERE field1 LIKE 'I'm'

Note the middle quotation is invalid, what is SQL's literal character, like / in C#

juergen d

Use double ' to escape it in SQL-Server

WHERE field1 LIKE 'I''m'

In other DB engines like MySQL using backslash works too

WHERE field1 LIKE 'I\'m'

SQLFiddle demo

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related