I have a table that will return an Integer. Many times the below query will return multiple IDs.
DECLARE @ID INT;
SELECT @ID = Id
FROM MyTable
I then have to execute a pre made stored procedure that accepts that Id. The Stored Procedure is setup to take one Id at a time (I can't change it to make a list). How can I get the stored procedure to iterate over the entire list of IDs Returned?
exec storedProc @ID