动态的创建一个存储过程
方法一: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)
as
declare @str varchar(500)
set @str = 'Select * from ' + @table
浙公网安备 33010602011771号