June 7, 2012

sp_replincrementlsn (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_replincrementlsn(nvarchar @publisher)

MetaData:

 create procedure sys.sp_replincrementlsn (  
@xact_seqno binary(10) OUTPUT,
@publisher sysname = NULL
)
as
declare @retcode int,
@cmd nvarchar(4000)

-- For SQL Server publisher, @publisher is NULL
if @publisher IS NULL
begin
exec @retcode = sys.sp_MSrepl_incrementlsn @xact_seqno OUTPUT
if @@ERROR <> 0 or @retcode <> 0
begin
return (1)
end
return (0)
end

-- For heterogeneous publisher, make equivalent call in distribution database context
EXEC @retcode = sys.sp_MSrepl_getpublisherinfo @publisher = @publisher,
@rpcheader = @cmd OUTPUT,
@skipSecurityCheck = 1

IF @retcode <> 0
RETURN (1)

-- Add sp
set @cmd = @cmd + N'sys.sp_IHreplincrementlsn'

EXEC @retcode = @cmd @xact_seqno OUTPUT,
@publisher

if @@ERROR <> 0 or @retcode <> 0
begin
return (1)
end
return (0)

No comments:

Post a Comment

Total Pageviews