热爱编程事业
方法一:create proc pub1
@table nvarchar(200),
@id int
as
exec('select * from ['+ @table+'] where id='+@id)
exec pub1 'admin','2'
方法二:
alter proc up_test @table varchar(500)
declare @str varchar(500)
set @str = 'Select * from ' + @table
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3