Hi leo,
If you want to check the IF Exists dynamically, you can use the following code also. The difference is you don't have to create/drop a temporary table.
------------------------------
CREATE PROCEDURE sp_blah
(
@tblName NVARCHAR(100)
)
AS
declare @sql varchar(1024)
Set @sql='Select this From ' + @tblName
exec(@sql)
IF @@rowcount>0
Print 'EXIST'
ELSE
Print 'Not Exist'
------------------------------
May this help you!