Reputation: 339
I want to set a variable to expressions like this 'word'
in SQL which consists of this ('
) character.
How can I do that?
Upvotes: 0
Views: 47
Reputation: 799
For SQL Server to show '
use ''
into select
SELECT 'aa''a'
Upvotes: 3
Reputation: 8497
You can use variable with Single quotes as following :-
DECLARE @varName VARCHAR(50)
SET @varName = '''word'''
SELECT @varName as colName
Output :- 'word'
Upvotes: 2