Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MShelptracertokens

  No additional text.


Syntax


-- Name:
--		sp_MShelptracertokens

-- Description:
--		This procedure is used to retrieve the tracer token lsns.
--		It returns a list of the time a publisher_commit a tracer token along with the
--		tracer token lsn which can be used when calling sp_MShelptracertokenhistory.

-- Parameters:
--		@publisher		sysname
--		@publisher_db	sysname
--		@publication	sysname								

-- Returns:
--		0 - succeeded
--      1 - failed

-- Result:
--		(see description)

-- Security:
--		DBO or replmonitor of distribution db (used by the UI)
-- Requires Certificate signature for catalog access

create procedure sys.sp_MShelptracertokens
(
	@publisher		sysname,
	@publisher_db	sysname,
	@publication	sysname
)
as
begin
	set nocount on
	
	declare @retcode			int,
			@publication_id		int,
			@distribution_db	sysname
	
	select @distribution_db = db_name()
	
	
	-- security check.
	-- User must be member of 'replmonitor' role in distribution database
	
	exec @retcode = sys.sp_MSrepl_DistributorReplMonitorAccess @distribution_db = @distribution_db
	if @retcode != 0 or @@error != 0
	    return 1

	-- Has to be executed from distribution database
	if sys.fn_MSrepl_isdistdb (@distribution_db) != 1
	begin
		-- sp_MSispeertopeeragent can only be executed in the distribution database.
		raiserror (21482, 16, -1, 'sp_MShelptracertokens', 'distribution')
		return 1
	end
	
	-- check to see if the publication exists
	select @publication_id = msp.publication_id
		from dbo.MSpublications msp
			join sys.servers ss
				on msp.publisher_id = ss.server_id
		where UPPER(ss.name) = UPPER(@publisher)
			and msp.publisher_db = @publisher_db
			and msp.publication = @publication
						
	if @publication_id is NULL
	begin
		-- Publication 'publication' does not exist.
		raiserror(21200, 16, -1, @publication)
		return 1
	end

	-- make sure to only return the tracer_ids
	-- that have tracer history information.
	select tracer_id,
			publisher_commit
		from MStracer_tokens
		where publication_id = @publication_id
			and tracer_id in (select parent_tracer_id
									from MStracer_history)
		order by publisher_commit desc

	return 0
end

 
Last revision 2008RTM
See also

  sp_helptracertokens (Procedure)
sp_MSdelete_tracer_history (Procedure)
sp_MShelptracertokenhistory (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash