BKW - have you thought of creating a dynamic T-SQL statement such as
CREATE PROCEDURE Dbo.GetIT
@TableName VARCHAR(5)
AS
DECLARE @Sql VARCHAR(50)
SET @Sql = 'SELECT * FROM ' + @TableName + '_Name'
PRINT @Sql -- print to be sure it is correct
EXECUTE @Sql -- add this to execute after verifying it is correct
Run as
dbo.getit 'mystu'
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please read[/url]
Before posting a performance problem please read[/url]