存储过程怎么动态接收表的名称 create proc pub@tableasselect * from @table这样写的存储过程,为什么会出错呀!那位老兄那帮助一下呀!怎么样的动态对表进行查询,我只要过表的名字进来就可以呀! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 create proc pub@tableasexec('select * from ['+ @table +']') create proc pub@tableasexec('select * from '+ @table +'') --創建create proc pub@table nvarchar(200)asexec('select * from ['+ @table+']')--調用exec pub 'titles' 关于SQL查询的一个问题 求SQL语句 请问:求出最近日期的sql语句? sql语句拼接问题 SQL 有没有switch写法? SQL Server 合并结果集 请问#a这样的临时表是什么时候被回收的。 怎样查询不要后面的小时分钟等? 如何实现同时对时间,年份机型比较?---在线等待。 高手进来,求SQL语句! ***求一SQL语句*** @@error能什么时候才能判断语句是否正确啊?
@table
as
exec('select * from ['+ @table +']')
@table
as
exec('select * from '+ @table +'')
create proc pub
@table nvarchar(200)
as
exec('select * from ['+ @table+']')
--調用
exec pub 'titles'