存储过程将表名作为参数传入,从以这个参数为表名的表里查询数据出错。 exec('select * from ' + @table + ' where ' + @condition + ' order by ' + @order) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ...exec('select * from ' +@表名变量 +' where .....') 能!create proc p_select @table varchar(25),@whereif varchar(255),@orderby varchar(100) as ...--得到@table,@whereif,@orderby的实际值! exec('select * from '+@table+' where '+@whereif+' order by '+@orderby)go exec('select * from '+@表名) 同时删除几个表的存储过程怎么写? 请问如何在SQL中得到4位随机数,并且每位的值范围都是0-9,A-Z的之间 多用户不连续插入时怎么利用上一次插入时产生的自增列的值进行自动赋值? sql问题 邹大侠帮忙来看一下~ 不下班了坐等高手解决难题 关于表中记录求差的问题! 导出数据到EXCEL表中数据列超过Z就报错是什么问题? sqlserver 过期备份自动覆盖的问题 有没有函数可以:使某个日期加上一个天数,可以得到相应的日期?急!! Access导入到SQLServer怎么设定默认值? 应该不算是个难问题,请进来看看
exec('select * from ' +@表名变量 +' where .....')
create proc p_select @table varchar(25),@whereif varchar(255),@orderby varchar(100)
as
...--得到@table,@whereif,@orderby的实际值!
exec('select * from '+@table+' where '+@whereif+' order by '+@orderby)go