Hi I want to delete several hundred records at once, but the system demands I use a stored procedure. I'm wondering if I can execute the procedure and do something like the following?
BEGIN TRANSACTION
EXECUTE UserDelete @ID = SELECT ID FROM #idlist, -- bigint
@ModifiedByLoginID = 11111 -- bigint
ROLLBACK TRANSACTION
--COMMIT TRANSACTION
I have tried this and it does not work so I'm just wondering if theres something I'm missing? Something else I need to add? Is this possible at all?
If more information is required please ask. Any help would be great.
User AlexK. (first comment below) pointed me in the direction of this link. SQL Call Stored Procedure for each Row without using a cursor It was exactly the answer I needed. I can't mark his comment as the answer so this edit seems appropriate.