• pietlinden (9/13/2013)


    One question though... when you remove the subscript from the array, does it act like a collection or something and you can just use IN(@Collection)??? Just trying to understand how it works!

    There are no arrays in T-SQL. There are no collections.

    col IN (@Collection)

    is the same as

    col = @collection

    That is, if @Colletion has the value[font="Courier New"] '1,2,4,7' [/font]and col has the value [font="Courier New"]'1,2,4,7'[/font] you will get a hit, else not.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]