存储过程中使用表名为参数


alter proc AnalysisPhoneModel @phonenum char(11),@mytablename char(100)
as 
exec('select * from '+@mytablename+' where phonenum='+@phonenum)
posted @ 2007-06-11 11:21 MadGoat 阅读(101) 评论(0) 编辑 收藏