I am having trouble finding the correct syntax to make this work?
I have a table with the columns id and color and I want to print out all of the id's for a specific color.
if exists(select id from mytable where color = 'red')
print id
if exists(select id from mytable where color = 'red')
print SCOPE_IDENTITY() --which won't work because i'm using select rather than insert
PRINTfrom SQL? SQL isn't designed to easily "print" the results of a query.