2021年4月5日星期一

Object Variable in a query

I am using SSDT 2017 and I am working on a solution that basically gets a full result set from a query into a variable (1 column only: AccountID), and I need to include the values in that object variable in a query, something like this:

"SELECT * FROM dbo.account WHERE AccountID IN (" + @AccountIDObjectVariable + ")"  

I tried with an expression but I get an error, so I am not sure if there's a better way, also I tried a for each loop container logic but since I have millions of record in the object variable I think that's not the best way.

Any idea?

https://stackoverflow.com/questions/66961235/object-variable-in-a-query April 06, 2021 at 08:14AM

没有评论:

发表评论