现在的位置: 首页 > 综合 > 正文

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

2012年03月13日 ⁄ 综合 ⁄ 共 138字 ⁄ 字号 评论关闭
alter proc AnalysisPhoneModel @phonenum char(11),@mytablename char(100)
as 
exec('select * from '+@mytablename+' where phonenum='+@phonenum)

抱歉!评论已关闭.