I have a stored procedure MyProcedure
which needs an int
as parameter, now I need to pass an int column from another table as parameter to the procedure. How can I write a statement to implement that? I can't use cursor in my code for some reasons. Below is my pseudo code. Thanks.
Create Procedure MyProcedure
@i_input INT
AS
... ...
create table MyTable
(
id int,
otherdata float
)
exec MyProcedure (select id from MyTable)