摘要: 众所周知,使用Exec来进行存储过程,其实Exec不但可以执行存储过程,还可以执行sql语句。例如:假设有一张表sc,我们查询它的所有信息,这里使用存储过程,为了说明以上问题。create proc test1_procasdeclare @str varchar(100)beginset @str='select * from sc'exec @strend当我们用 exec test1_proc 执行这个存储过程时,会发生错误提示“找不到存储过程 'select * from sc'。”这是为什么呢?因为系统把 @str所代表的字符串select * fro 阅读全文
posted @ 2011-06-14 16:41 佳园 阅读(3640) 评论(1) 推荐(4) 编辑