SQL Remote event-hook procedures
Thefollowing stored procedure names and arguments provide the interface
forcustomizing synchronization at SQL Remote databases.
Notes Unlessotherwise stated, the following apply to event-hook procedures:
♦Thestored procedures must either have DBA authority ( Adaptive Server
Anywhere) or dbo authority (Adaptive Server Enterprise).
♦Theprocedure must not commit or rollback operations, or perform any
actionthat performs an implicit commit. Theactions of the procedure are
automaticallycommitted by the calling application.
♦Youcan troubleshoot the hooks by turning on the Message Agent verbose
mode.
♦Thehooks for
dbremote
and
ssremote
differonly in name.
The#hook_dict table The#hook_dict table is created immediately before a hook is called using
thefollowing CREATE statement:
CREATE table #hook_dict(
name VARCHAR(128) NOT NULL UNIQUE,
value VARCHAR(255) NOT NULL )
TheMessage 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
MessageAgent.
sp_hook_dbremote_begin and sp_hook_ssrmt_begin
Function Usethis stored procedure to add custom actions at the beginning of the
replicationprocess.
Rowsin #hook_dict table
Name Values Description
send trueor false Indicates if the process is performing the send
phaseof replication.
receive trueor false Indicates if the process is performing the re-
ceivephase of replication
Description Ifa procedure of this name exists, it is called when the Message Agent starts.
sp_hook_dbremote_end and sp_hook_ssrmt_end
Function Usethis stored procedure to add custom actions just before the Message
320