Hi,
I am trying to pass the table name to stored procedure and then use the passing table name in select, update or delete query statement.
When I tried to do that, I got the error such as '@tablename must be declared'.
The example syntax would be like below.
CREATE PROCEDURE procedure_name
@tablename varchar(50)
AS
BEGIN
SELECT *
FROM @tablename
END
Is there anyway I can pass the table name to stored procedure?