User's Manual
SQL Remote event-hook procedures
The following stored procedure names and arguments provide the interface
for customizing synchronization at SQL Remote databases.
Notes Unless otherwise stated, the following apply to event-hook procedures:
♦ The stored procedures must either have DBA authority ( Adaptive Server
Anywhere ) or dbo authority (Adaptive Server Enterprise).
♦ The procedure must not commit or rollback operations, or perform any
action that performs an implicit commit. The actions of the procedure are
automatically committed by the calling application.
♦ You can troubleshoot the hooks by turning on the Message Agent verbose
mode.
♦ The hooks for
dbremote
and
ssremote
differ only in name.
The #hook_dict table The #hook_dict table is created immediately before a hook is called using
the following CREATE statement:
CREATE table #hook_dict(
name VARCHAR(128) NOT NULL UNIQUE,
value VARCHAR(255) NOT NULL )
The Message Agent uses the #hook_dict table to pass values to hook
functions; hook functions use the #hook_dict table to pass values back to the
Message Agent.
sp_hook_dbremote_begin and sp_hook_ssrmt_begin
Function Use this stored procedure to add custom actions at the beginning of the
replication process.
Rows in #hook_dict table
Name Values Description
send true or false Indicates if the process is performing the send
phase of replication.
receive true or false Indicates if the process is performing the re-
ceive phase of replication
Description If a procedure of this name exists, it is called when the Message Agent starts.
sp_hook_dbremote_end and sp_hook_ssrmt_end
Function Use this stored procedure to add custom actions just before the Message
320