all groups > sql server programming > july 2004 >
You're in the

sql server programming

group:

Single Quote as part of a string in a query


Single Quote as part of a string in a query CSURESHKANAN
7/22/2004 10:43:03 PM
sql server programming:
Hai,

Im suresh, how do i insert a string with single quotation into a field in sqlserver via stored procedure. eg. ' ' im using frontend as vb.
Re: Single Quote as part of a string in a query Roji. P. Thomas
7/23/2004 11:51:22 AM
You can Escape the single quote character with another single quote.

Like


CREATE TABLE #temp(somevalue varchar(20))
INSERT INTO #temp Values('Mc''Donald')
SELECT * FROM #temp
DROP TABLE #temp

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


[quoted text, click to view]

AddThis Social Bookmark Button