| title | sp_posttracertoken (Transact-SQL) | Microsoft Docs | ||||
|---|---|---|---|---|---|
| ms.custom | |||||
| ms.date | 03/14/2017 | ||||
| ms.prod | sql-server-2016 | ||||
| ms.reviewer | |||||
| ms.suite | |||||
| ms.technology |
|
||||
| ms.tgt_pltfrm | |||||
| ms.topic | language-reference | ||||
| applies_to |
|
||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| ms.assetid | 24da5cd2-1c45-475e-93db-5bdf660f1c2c | ||||
| caps.latest.revision | 28 | ||||
| author | BYHAM | ||||
| ms.author | rickbyh | ||||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]
This procedure posts a tracer token into the transaction log at the Publisher and begins the process of tracking latency statistics. Information is recorded when the tracer token is written to the transaction log, when it is picked up by the Log Reader Agent, and when it is applied by the Distribution Agent. This stored procedure is executed at the Publisher on the publication database. For more information, see Measure Latency and Validate Connections for Transactional Replication.
Transact-SQL Syntax Conventions
sp_posttracertoken [ @publication = ] 'publication'
[ , [ @tracer_token_id = ] tracer_token_id OUTPUT
[ , [ @publisher = ] 'publisher'
[ @publication= ] 'publication'
Is the name of the publication for which latency is being measured. publication is sysname, with no default.
[ @tracer_token_id= ] tracer_token_idOUTPUT
Is the ID of the tracer token inserted. tracer_token_id is int with a default of NULL, and it is an OUTPUT parameter. This value can be used to execute sp_helptracertokenhistory (Transact-SQL) or sp_deletetracertokenhistory (Transact-SQL) without first executing sp_helptracertokens (Transact-SQL).
[ @publisher= ] 'publisher'
Specifies a non-[!INCLUDEmsCoName] [!INCLUDEssNoVersion] Publisher. publisher is sysname, with a default of NULL and should not be specified for a [!INCLUDEssNoVersion] Publisher.
0 (success) or 1 (failure)
sp_posttracertoken is used in transactional replication.
[!code-sqlHowTo#sp_tracertokens]
Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_posttracertoken.
Measure Latency and Validate Connections for Transactional Replication