I have a question regarding if and how this can be done in a stored procedure.
the sql statement uses an IN statement, from a string that I am building in the proc.
I basically use a string like to build a variable @sc - which equals 'H','X','T'
select @sc = @sc + ",'" + @ssss + "'"
and then the where statement looks like this:
d.sc in (@sc)
so this comes back empty.
when I do this below, it comes back with Data. How can I get the IN statement to work in a Stored proc.
d.sc = @sc1 or d.sc = @sc2 - sc1 = 'H', sc2 = 'X'.
bsh
the sql statement uses an IN statement, from a string that I am building in the proc.
I basically use a string like to build a variable @sc - which equals 'H','X','T'
select @sc = @sc + ",'" + @ssss + "'"
and then the where statement looks like this:
d.sc in (@sc)
so this comes back empty.
when I do this below, it comes back with Data. How can I get the IN statement to work in a Stored proc.
d.sc = @sc1 or d.sc = @sc2 - sc1 = 'H', sc2 = 'X'.
bsh