Embedding single quotes into an SQL text field

Question:
Is there any way I can use a single quote in a string and use that string as a value in a text field? Is there an escape character, such as the backslash in Perl?

Answer:
In SQL Server you can use two single quotes to represent a single quote:

 select 'here''s the rub'

or use the full quotes:

"here's the rub"

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: