delphi 7 and mssql 2008 are requirements I can’t change for a new project I’m starting to work and if possible I’d like to get notifications/events if data changes on the server so I don’t have to poll so the question is:
is it possible to utilize SQLService broker with D7 or is there something similar (was reading/thinking about crosstalk and ado.net but support starts only at D2007)?
Update: Just to be absolutely clear, I want to be able to get an Event if data changes in certain tables (eg. insert/updates on specific tables) and not if a table/database changes.
Yes, is possible use delphi to access to the notifications and Events exposed by the MSSQL Service Broker. To do this you can use the
WMI Provider for Server Eventswhich exposes a very rich set of WMi events and classes. If you are new to the WMI, I recommend you which read these articlesAccesing the WMI from Object Pascal CodeandDelphi and WMI Eventsalso you can use theWMI Delphi Code Creatorto create an Delphi snippet to access the events of theMSSQL Service Broker.