Hi,
I need to have an varchar value with single quotes. For eg: the below code throws compilation error.
Declare @.val VARCHAR(20)
SELECT @.val = ''+name+''
print @.val
Error: Invalid column 'name'
I want to print name enclosed with single quotes. Please guide me.
Regards,
SamDeclare @.val VARCHAR(20)
SELECT @.val = 'Kaiowas'
PRINT @.VAL
EDIT (added): SET @.VAL = @.VAL + '''Kaiowas'''
EDIT (added): PRINT @.VAL
SET @.VAL = @.VAL + '''' + @.VAL + ''''
PRINT @.VAL
Showing posts with label declare. Show all posts
Showing posts with label declare. Show all posts
Subscribe to:
Posts (Atom)