|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 05/14/2012 : 14:55:18
|
quote: Originally posted by allan8964
Hi there,
I need compare a value to a column in a table1:
table1 Id | Code | 01 | CCD 02 | FFT
How can I check if @varName is one of the values in column Code?
Thanks.
SELECT * FROM table1 WHERE Code = @varname If you simply want a YES or NO answer:IF EXISTS (SELECT * FROM table1 WHERE Code = @varname)
SELECT 'Yes'
ELSE
SELECT 'No' |
 |
|