Discussion:
send comma delimited string as parameter
(too old to reply)
mcnewsxp
2012-11-02 13:14:34 UTC
Permalink
i want to do an update query that takes a comma delimited string as input. each item will be used in the where clause of the update statement. how would i code this?

tia,
mcnewsxp
Bob Barrows
2012-11-02 13:59:46 UTC
Permalink
Post by mcnewsxp
i want to do an update query that takes a comma delimited string as
input. each item will be used in the where clause of the update
statement. how would i code this?
tia,
mcnewsxp
See:
http://www.sommarskog.se/arrays-in-sql.html
mcnewsxp
2012-11-02 14:45:38 UTC
Permalink
Post by Bob Barrows
Post by mcnewsxp
i want to do an update query that takes a comma delimited string as
input. each item will be used in the where clause of the update
statement. how would i code this?
tia,
mcnewsxp
http://www.sommarskog.se/arrays-in-sql.html
thanks much
i used this approach but changed the select to update.

UPDATE EVENT SET EV_ATTENDANCE_STATUS = 1
FROM EVENT e
INNER JOIN #1 t
ON t.IDList = e.EV_EVENT_ID
WHERE t.IDList = e.EV_EVENT_ID
mcnewsxp
2012-11-02 14:47:47 UTC
Permalink
Post by mcnewsxp
Post by Bob Barrows
Post by mcnewsxp
i want to do an update query that takes a comma delimited string as
input. each item will be used in the where clause of the update
statement. how would i code this?
tia,
mcnewsxp
http://www.sommarskog.se/arrays-in-sql.html
thanks much
i used this approach but changed the select to update.
UPDATE EVENT SET EV_ATTENDANCE_STATUS = 1
FROM EVENT e
INNER JOIN #1 t
ON t.IDList = e.EV_EVENT_ID
WHERE t.IDList = e.EV_EVENT_ID
oops - this approach:
http://www.codeproject.com/Articles/5986/Passing-a-Comma-Delimited-Parameter-to-a-Stored-Pr
Loading...