Define variable to use with IN operator (T-SQL)

后端 未结 14 2120
心在旅途
心在旅途 2020-11-28 04:24

I have a Transact-SQL query that uses the IN operator. Something like this:

select * from myTable where myColumn in (1,2,3,4)

Is there a wa

14条回答
  •  忘掉有多难
    2020-11-28 04:41

    I think you'll have to declare a string and then execute that SQL string.

    Have a look at sp_executeSQL

提交回复
热议问题