I want to pass a comma delimeted string of PK's (int) into a sql stored proc. The proc would then perform an update statement on the table using a where clause including each of the PK's.
What is the best way to do this?
I want to pass a comma delimeted string of PK's (int) into a sql stored proc. The proc would then perform an update statement on the table using a where clause including each of the PK's.
What is the best way to do this?
We need more information. For instance if the update uses information from tables (joins) or of the rows are getting updated with the same information then you can use:
Update tableName
set ....
where tableName.id in @strOfIdsPassedIn