I am trying the write a stored procedure for Delete. But for performance we have changed the delete sql query to use IN
operation. I want write the procedure where it accepts comma separated IDs to procedure.
I have tried to write a procedure where it accepts single Entry ID. The procedure is like below.
CREATE PROCEDURE DeleteListEntry
@entryid int
AS
DELETE FROM LIST_ITEMS
WHERE ENTRY_ID = @entryid;
go
I want to know how to convert above procedure to accept bulk entries. The sql query for it is below-
DELETE FROM LIST_ITEMS WHERE ENTRY_ID IN (id1, id2, id2, ... );