
Originally Posted by
transio
I don't remember the exact implementation... as far as I recall, SPLIT returns a resultset, so you should be able to do something like "SELECT * FROM dbo.SPLIT(@idsString);"
Try to get that working by itself first and then worry about putting it in an "IN" statement.
ok - so this work fine:
Code:
declare @idsString nvarchar(max)
set @idsString = N'2,3,4'
SELECT * FROM dbo.SPLIT(@idsString,1,0)
returning
2
3
4
but this still fails:
Code:
declare @idsString nvarchar(max)
set @idsString = N'2,3,4'
SELECT *
FROM mytable
WHERE mytable.intID IN (dbo.SPLIT(@idsString,1,0))
Bookmarks