-3
WHERE Variable = 'Lowe's';

But string is ending at Lowe because it recognizes the 's as end of String.

How to circumvent this?

John Conde
  • 212,985
  • 98
  • 444
  • 485
ZJAY
  • 2,057
  • 8
  • 25
  • 48

2 Answers2

4

Use two '

WHERE Variable = 'Lowe''s'

SQLFiddle demo

juergen d
  • 195,137
  • 36
  • 275
  • 343
2

Although escaping ' with '' works, in case you are running this command from any application you should take a look at databinding and using SqlParameters - spares you a lot of headache, improves performance and security.

Linky
  • 595
  • 7
  • 23