标签:object_id end HERE set table union drop ace roc
create proc [dbo].[proc_Delete]
@TableName varchar(50),
@Id varchar(5000)
as
begin
declare @strSql varchar(5000)
declare @sql varchar(4000)
set @sql=‘select col=‘‘‘+ replace(@Id,‘,‘,‘‘‘ union all select ‘‘‘)+‘‘‘‘
if OBJECT_ID(‘tempdb..#DelID‘) is not null
drop table #DelID
create table #DelID(ID VARCHAR(36))
insert into #DelID exec(@sql)
set @strSql = ‘delete from ‘+@TableName+‘ where RId in ( select ID from #DelID)‘
exec(@strSql)
end
GO
标签:object_id end HERE set table union drop ace roc
原文地址:https://www.cnblogs.com/yuqianwangnan/p/9381359.html