Passing parameter to SQL select statement IN clause acts weird.

前端 未结 4 1268
暗喜
暗喜 2021-01-21 11:38

I\'ve got the following query that returns 2 records (in DataSet\'s query builder)

SELECT        EmpID, Name, id
FROM          Users
WHERE        (CAST(id AS Var         


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-21 12:08

    A variable is not allowed in the IN clause.
    You are expecting the values as a comma delimited string you could use the split function (user defined and non-standard) to join them with the original tables:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=326300&SiteID=1

    For more information you can visit this

提交回复
热议问题