How can I use the table name as a parameter in a stored procedure?
I am doing it like this but I'm getting an error
ALTER PROCEDURE [dbo].[usp_TablesReporting_GetTableData]
@tableName as VARCHAR(100)
AS
BEGIN
SELECT * FROM @tablename
END
Error:
Must declare the table variable "@tableName"