We use it like this: MsgTraeEvent.Active := False; MsgTraeEvent.Connection := DM.Conn; MsgTraeEvent.Names.Clear; MsgTraeEvent.Names.Add('QUEUE=' + 'q' + FMsgTraeServiceName); MsgTraeEvent.Names.Add('SERVICE=' + 's' + FMsgTraeServiceName); MsgTraeEvent.Names.Add('CHANGE2=trae;SELECT Updated, Status ' + 'FROM dbo.MsgTrae '); MsgTraeEvent.Register;
FMsgTraeServiceName is a unique Name. We drop the service manually with DROP SERVICE 's'+FMsgTraeServiceName; DROP QUEUE 'q'+FMsgTraeServiceName;
"SELECT Updated, Status FROM dbo.MsgTrae" is the SQL which we want to check for updates. If an update is recognized, the MsgTraeEvent-Alert-Event fires.
|