Loop through all the rows of a temp table and call a stored procedure for each row
you could use a cursor: DECLARE @id int DECLARE @pass varchar(100) DECLARE cur CURSOR FOR SELECT Id, Password FROM @temp OPEN cur FETCH NEXT FROM cur INTO @id, @pass WHILE @@FETCH_STATUS = 0 BEGIN EXEC mysp @id, @pass … — call your sp here FETCH NEXT FROM cur INTO @id, @pass END CLOSE cur DEALLOCATE … Read more