What about a user defined function to take in a list of strings.. i.e.
mike,tom,bob,herb and then the function would loop over the names and
add the quotes and build a new string tor eturn and use in the IN
clause. Do you forsee problems with that approach?
Mike
> > What is the best way to pass a list of strings into a
> stored proc for
> > use with an IN operator.
>
> Unfortunately, I don't think there's a good way to do this.
> There's no "list" datatype within SQL, so you have to use a
> large VARCHAR for your datatype, but there's no way to easily
> tell SQL that it's a list rather than a single value.
>
> In the cases where I've had to do this, I've ended up just
> executing a string of text within my stored procedure. Using
> SQL Server 2000, you might do this using sp_executesql or EXECUTE.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

