May 7, 2012

sp_MSanonymous_status (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


sys.sp_MSanonymous_status(int @agent_id
, int @no_init_sync
, varbinary @last_xact_seqno)


 CREATE PROCEDURE sys.sp_MSanonymous_status  
@agent_id int,
@no_init_sync int = 0,
@last_xact_seqno varbinary(16)
set nocount on

declare @virtual_agent_id int -- virtual sub agent id --
declare @anonymous_agent_id int -- virtual anonymous agent id --

-- Note @agent_id will be overwritten later.
select @virtual_agent_id = virtual_agent_id,
@anonymous_agent_id = anonymous_agent_id
from MSdistribution_agents where
id = @agent_id

-- Return error if agent entry does not exists (being deleted).
if @virtual_agent_id is null
raiserror(21072, 16, -1)

-- If no init sync, use anonymous account to start immediately.
-- If first time, or still working on the first snapshot, or just finished
-- the first snapshot, use virtual account. This is to cover the case
-- of multiple snapshot transactions (for example, one per article) in the first
-- snapshot.
-- otherwise use virtual anonymous account
if @no_init_sync = 1
select @agent_id = @anonymous_agent_id
else if @last_xact_seqno = 0x00
select @agent_id = @virtual_agent_id
select @agent_id = @anonymous_agent_id

-- Call main procedure for to get status
-- PAL security check is done in the main proc
exec sys.sp_MSsubscription_status
@agent_id = @agent_id

No comments:

Post a Comment

Total Pageviews