Passing a list of values through a declared variable
Posted on 2012-08-28
Up to this point, my SQL has been simplistic in that I've done my DECLARE and SET statements where I'm passing just one string --
DECLARE @FDOS DATETIME
SET @FDOS = '2012/01/01'
My question is how can I dynamically pass more than one value at runtime?
I keep researching and trying to test how to do dynamically but I haven't been able to figure out based on my not understanding the complexity of some of the UDF and cursors referenced.
So for example, let's say that I know I want to pass the following random variables -- these are points of service strings: '20', '21', '22', '23'
1. Could you advise how you would set up a
& SET @POS ?
2. Also, is it possible to do a LIKE statement (if I want to say where POS LIKE '2%')
Thanks so much.