September 30, 2009 at 9:24 am
Gurus,
I have a table with a column of varchar type.
Values are some thing like
ASO '02 CHOICE 06
ASO '02 CHOICE 07
ASO '02 CHOICE 08
How do I compare the value in where clause
Select *
from t
where c1 = 'ASO '02 CHOICE 06'
getting error
Thanks.
Cnu
September 30, 2009 at 9:34 am
Try this:
SET QUOTED_IDENTIFIER OFF
GO
Select *
from t
where c1 = "ASO '02 CHOICE 06"
HTH,
Supriya
September 30, 2009 at 9:39 am
Thanks for help.
Its working supriya.
Cnu
September 30, 2009 at 9:49 am
Also,
if you want to avoid
SET QUOTED_IDENTIFIER OFF
you can also use this
Select *
from t
where c1 = 'ASO ''02 CHOICE 06'
here there are two single quotes before 02 which sql reads as a single quote when used in a string
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply