create procedure sys.sp_MSdelrowsbatch_downloadonly (
@pubid uniqueidentifier,
@tablenick int,
@check_permission int = 0,
@rows_tobe_deleted int,
@rowguid1 uniqueidentifier,
@rowguid2 uniqueidentifier = NULL,
@rowguid3 uniqueidentifier = NULL,
@rowguid4 uniqueidentifier = NULL,
@rowguid5 uniqueidentifier = NULL,
@rowguid6 uniqueidentifier = NULL,
@rowguid7 uniqueidentifier = NULL,
@rowguid8 uniqueidentifier = NULL,
@rowguid9 uniqueidentifier = NULL,
@rowguid10 uniqueidentifier = NULL,
@rowguid11 uniqueidentifier = NULL,
@rowguid12 uniqueidentifier = NULL,
@rowguid13 uniqueidentifier = NULL,
@rowguid14 uniqueidentifier = NULL,
@rowguid15 uniqueidentifier = NULL,
@rowguid16 uniqueidentifier = NULL,
@rowguid17 uniqueidentifier = NULL,
@rowguid18 uniqueidentifier = NULL,
@rowguid19 uniqueidentifier = NULL,
@rowguid20 uniqueidentifier = NULL,
@rowguid21 uniqueidentifier = NULL,
@rowguid22 uniqueidentifier = NULL,
@rowguid23 uniqueidentifier = NULL,
@rowguid24 uniqueidentifier = NULL,
@rowguid25 uniqueidentifier = NULL,
@rowguid26 uniqueidentifier = NULL,
@rowguid27 uniqueidentifier = NULL,
@rowguid28 uniqueidentifier = NULL,
@rowguid29 uniqueidentifier = NULL,
@rowguid30 uniqueidentifier = NULL,
@rowguid31 uniqueidentifier = NULL,
@rowguid32 uniqueidentifier = NULL,
@rowguid33 uniqueidentifier = NULL,
@rowguid34 uniqueidentifier = NULL,
@rowguid35 uniqueidentifier = NULL,
@rowguid36 uniqueidentifier = NULL,
@rowguid37 uniqueidentifier = NULL,
@rowguid38 uniqueidentifier = NULL,
@rowguid39 uniqueidentifier = NULL,
@rowguid40 uniqueidentifier = NULL,
@rowguid41 uniqueidentifier = NULL,
@rowguid42 uniqueidentifier = NULL,
@rowguid43 uniqueidentifier = NULL,
@rowguid44 uniqueidentifier = NULL,
@rowguid45 uniqueidentifier = NULL,
@rowguid46 uniqueidentifier = NULL,
@rowguid47 uniqueidentifier = NULL,
@rowguid48 uniqueidentifier = NULL,
@rowguid49 uniqueidentifier = NULL,
@rowguid50 uniqueidentifier = NULL,
@rowguid51 uniqueidentifier = NULL,
@rowguid52 uniqueidentifier = NULL,
@rowguid53 uniqueidentifier = NULL,
@rowguid54 uniqueidentifier = NULL,
@rowguid55 uniqueidentifier = NULL,
@rowguid56 uniqueidentifier = NULL,
@rowguid57 uniqueidentifier = NULL,
@rowguid58 uniqueidentifier = NULL,
@rowguid59 uniqueidentifier = NULL,
@rowguid60 uniqueidentifier = NULL,
@rowguid61 uniqueidentifier = NULL,
@rowguid62 uniqueidentifier = NULL,
@rowguid63 uniqueidentifier = NULL,
@rowguid64 uniqueidentifier = NULL,
@rowguid65 uniqueidentifier = NULL,
@rowguid66 uniqueidentifier = NULL,
@rowguid67 uniqueidentifier = NULL,
@rowguid68 uniqueidentifier = NULL,
@rowguid69 uniqueidentifier = NULL,
@rowguid70 uniqueidentifier = NULL,
@rowguid71 uniqueidentifier = NULL,
@rowguid72 uniqueidentifier = NULL,
@rowguid73 uniqueidentifier = NULL,
@rowguid74 uniqueidentifier = NULL,
@rowguid75 uniqueidentifier = NULL,
@rowguid76 uniqueidentifier = NULL,
@rowguid77 uniqueidentifier = NULL,
@rowguid78 uniqueidentifier = NULL,
@rowguid79 uniqueidentifier = NULL,
@rowguid80 uniqueidentifier = NULL,
@rowguid81 uniqueidentifier = NULL,
@rowguid82 uniqueidentifier = NULL,
@rowguid83 uniqueidentifier = NULL,
@rowguid84 uniqueidentifier = NULL,
@rowguid85 uniqueidentifier = NULL,
@rowguid86 uniqueidentifier = NULL,
@rowguid87 uniqueidentifier = NULL,
@rowguid88 uniqueidentifier = NULL,
@rowguid89 uniqueidentifier = NULL,
@rowguid90 uniqueidentifier = NULL,
@rowguid91 uniqueidentifier = NULL,
@rowguid92 uniqueidentifier = NULL,
@rowguid93 uniqueidentifier = NULL,
@rowguid94 uniqueidentifier = NULL,
@rowguid95 uniqueidentifier = NULL,
@rowguid96 uniqueidentifier = NULL,
@rowguid97 uniqueidentifier = NULL,
@rowguid98 uniqueidentifier = NULL,
@rowguid99 uniqueidentifier = NULL,
@rowguid100 uniqueidentifier = NULL
)
as
set nocount on
declare @procname nvarchar(270)
declare @retcode int
-- NOTE: this stored procedure returns 0 to indicate failure
-- security check
exec @retcode=sys.sp_MSreplcheck_subscribe
if @retcode<>0 or @@ERROR<>0 return (1)
if @check_permission =1
begin
declare @objid int
declare @permissions int
select @objid=objid, @permissions=check_permissions from dbo.sysmergearticles
where nickname=@tablenick and (pubid is NULL or pubid=@pubid)
if @objid is NULL
return (0)
exec @retcode = sys.sp_MSreplcheck_permission @objid = @objid, @type = 3, @permissions = @permissions
if @retcode<>0 or @@ERROR<>0
return (4)
end
select @procname= 'dbo.' + delete_proc from dbo.sysmergearticles where nickname = @tablenick and pubid=@pubid
select @retcode = 1
exec @retcode = @procname
@rows_tobe_deleted,
null,
@rowguid1,
@rowguid2,
@rowguid3,
@rowguid4,
@rowguid5,
@rowguid6,
@rowguid7,
@rowguid8,
@rowguid9,
@rowguid10,
@rowguid11,
@rowguid12,
@rowguid13,
@rowguid14,
@rowguid15,
@rowguid16,
@rowguid17,
@rowguid18,
@rowguid19,
@rowguid20,
@rowguid21,
@rowguid22,
@rowguid23,
@rowguid24,
@rowguid25,
@rowguid26,
@rowguid27,
@rowguid28,
@rowguid29,
@rowguid30,
@rowguid31,
@rowguid32,
@rowguid33,
@rowguid34,
@rowguid35,
@rowguid36,
@rowguid37,
@rowguid38,
@rowguid39,
@rowguid40,
@rowguid41,
@rowguid42,
@rowguid43,
@rowguid44,
@rowguid45,
@rowguid46,
@rowguid47,
@rowguid48,
@rowguid49,
@rowguid50,
@rowguid51,
@rowguid52,
@rowguid53,
@rowguid54,
@rowguid55,
@rowguid56,
@rowguid57,
@rowguid58,
@rowguid59,
@rowguid60,
@rowguid61,
@rowguid62,
@rowguid63,
@rowguid64,
@rowguid65,
@rowguid66,
@rowguid67,
@rowguid68,
@rowguid69,
@rowguid70,
@rowguid71,
@rowguid72,
@rowguid73,
@rowguid74,
@rowguid75,
@rowguid76,
@rowguid77,
@rowguid78,
@rowguid79,
@rowguid80,
@rowguid81,
@rowguid82,
@rowguid83,
@rowguid84,
@rowguid85,
@rowguid86,
@rowguid87,
@rowguid88,
@rowguid89,
@rowguid90,
@rowguid91,
@rowguid92,
@rowguid93,
@rowguid94,
@rowguid95,
@rowguid96,
@rowguid97,
@rowguid98,
@rowguid99,
@rowguid100
if @@error<>0 and @retcode=1
return 0
return @retcode