Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Jul 20, 1998

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"
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date