[thelist] mssql stored procedure-using a variablefor 'AND'and'OR'

Ken Schaefer Ken at adOpenStatic.com
Tue Aug 26 02:40:46 CDT 2008


> -----Original Message-----
> From: thelist-bounces at lists.evolt.org [mailto:thelist-bounces at lists.evolt.org]
> On Behalf Of Joel D Canfield
> Sent: Tuesday, 26 August 2008 5:06 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] mssql stored procedure-using a variablefor 'AND'and'OR'
>
> > In the sproc you have code that parses the string, separating
> > out each term.
>
> understood, conceptually. but practically, I have no more clue how to do
> this than fly.
>
> pointers to resources or examples, maybe?


http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm has a simple example of building dynamic SQL statement, and also (in the subsequent examples) of parsing a comma separate list into individual elements. He puts those into a table, rather than building an SQL statement with them, but the basic idea is there.

http://www.google.com/search?q=pass+comma+separated+list+into+SQL+Server+sproc has more examples

Cheers
Ken



More information about the thelist mailing list