Execute a Stored Procedure with a table as input
Is it possible to use a table as input for a stored procedure?
EXEC sp_Proc SELECT * FROM myTable
When trying this, I get the following error : Procedure or Function
'sp_Proc' expects parameter '@id', which was not supplied.
Here is sp_Proc
CREATE PROCEDURE sp_Proc
@id INT,
@name varchar(5)
AS
BEGIN
SET NOCOUNT ON;
SELECT @id + 1
END
GO
Here is myTable
id INT
name varchar(5)
3 records are in myTable
id name
--- ----
1 john
2 sally
3 ken
No comments:
Post a Comment