CREATE PROC sp_Select_Table @TableName NVARCHAR(200) AS if charindex(' ', @TableName)<=0 begin DECLARE @sql NVARCHAR(1000) SET @sql='SELECT * FROM ' + @TableName EXEC (@sql) end GO