alter proc SP_CheckTable
(
@TableName Nvarchar(100)
)Asdeclare @strSql nvarchar(500)  Set @strSql = N'select companyname from ' + @TableName + 
       N' where (companyname is null or companyname = '''')'
  exec @strSql
执行语句:
exec sp_checktable @TableName='E20061116'
出错提示:
服务器: 消息 2812,级别 16,状态 62,行 12
未能找到存储过程 'select companyname from E20061116 where (companyname is null or companyname = '')'。