Show TOC

rs_get_lastcommitLocate this document in the navigation structure

Returns rows from the <rs_lastcommit> system table.

Example 1
Creates an rs_get_lastcommit function string that executes a stored procedure named rs_get_lastcommit. The text of the stored procedure is:
create procedure rs_get_lastcommit
 select origin, origin_qid, secondary_qid
   from rs_lastcommit
create function string rs_get_lastcommit
 for sqlserver_derived_class
 output language
 'execute rs_get_lastcommit'
  • Replication Server executes rs_get_lastcommit when it starts up a DSI process for a database. The function returns all of the rows in the <rs_lastcommit> system table. Replication Server uses this information to find the last transaction committed from each primary data source.

  • The <rs_lastcommit> system table is updated each time Replication Server commits a transaction in the database.

  • rs_get_lastcommit has function-string-class scope.

  • Replication Server creates an initial rs_get_lastcommit function string for the system-provided function-string classes during installation.

  • If you use a user-created base function-string class, you must create an rs_get_lastcommit function string.

  • Create or customize an rs_get_lastcommit function string at the Replication Server that is the primary site for the class.

  • The default rs_get_lastcommit function string for the <rs_sqlserver_function_class> and <rs_default_function_class> classes updates the <rs_lastcommit> table by executing a stored procedure named rs_update_lastcommit in the rs_commit function string.

  • rs_get_lastcommit must return columns in the correct order for each primary database whose data is replicated in the database.

Table 1: Columns Returned by rs_get_lastcommit

Column Name





The ID number for the primary database the row represents



Identifies the last committed transaction in the stable queue for the origin database



If a subscription materialization queue exists for the origin database, this column contains the last transaction in that queue that has been committed in the replicate database