Home Forums Article Discussions Article Discussions by Author Discuss content posted by Kenneth Fisher Single Quotation Marks in SQL RE: Single Quotation Marks in SQL
pop022
Old Hand
Points: 336
More actions
January 3, 2013 at 7:53 am
#1573340
I know the point you were trying to get across, but using sp_executesql is not needed to print the value of the variable. It could simply be written as follows.
DECLARE @quotedvar nvarchar(100)
SET @quotedvar = 'O''Neil'
PRINT @quotedvar