Hi, I have a question about the 'IN' clause.

I want to accomplish the following, (in a stored
procedure), but I can't see how it can be done.

I need to use the 'IN' clause to insert records in to
a table.  The problem is that the list I want to
search, contains strings.

(The information is taken from an ASP page that allows
the user to send a quick message to multiple
recipients.  Just like a normal mail app, the user
just enters all the names seperated by a space of
comma (on processing, spaces are replaced with commas)

When the string get sent to the SP, it actually sees
it as only one string, and therefor never finds a
match:

ex.


I want:


SELECT M.Member_ID
FROM   Members M
WHERE  M.Member_Name IN ('name1', 'name2', 'name3')


That's what I want, but the problem is, this is what
happens.

The list of "Member_Name"'s is passed as a VARCHAR
variable like this:

@Member_Names = 'name1, name2, name3'

So, when the query is run, it's acutally looking for
one long Member name called "name1, name2, name3" and
obviously it never finds it.

Is there any work around for this?  Does anyone have
an other ideas for handling such a thing?

Thanks,
Andy

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to