I very simple (but reliable) alternative approach might be to periodically (say 
every 30 seconds or whatever makes sense for your app) fire a simple query like 
“select max(DateUpdated) from MyTable” (assuming you have a DateUpdated column) 
and if the result returned is greater than the last value you have, you just do 
a refresh on that particular table/query in the UI.

 

Regards

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of David O'Brien
Sent: Tuesday, 3 April 2012 8:47 a.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] SqlDependency

 

Thanks.

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of Jolyon Smith
Sent: Tuesday, 3 April 2012 8:08 a.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] SqlDependency

 

As far as I can tell, SQLDepedency is just a high level wrapper around SQL 
Server Query Notifications - you could (if someone hasn't done it already) 
create such a high level wrapper yourself, or just build what you need on the 
core services themselves.  Instead of Google'ing "SQLDependency", try instead 
"SQL Server Query Notification".

These articles in particular may be useful:

http://msdn.microsoft.com/en-us/library/ms130764.aspx

http://www.simple-talk.com/sql/t-sql-programming/using-and-monitoring-sql-2005-query-notification/

You will note that there is quite a bit of infrastructure required in the DB 
itself to get this stuff up and running and there are some quite specific 
conditions that have to be met by the query itself - it's not just a case of 
"notify me about this query".  At the very least you need a queue and Service 
Broker to be running.  Whether you are in a position to put that infrastructure 
in place may determine whether or not this approach is even viable in your case.


hth





On 3 April 2012 02:33, Jackson Gomes <[email protected]> wrote:

you may try CrossTalk, which allows you to import .NET classes and Libs and use 
them on Delphi

 

http://www.atozed.com/crosstalk/index.en.aspx 

  _____  

Date: Mon, 2 Apr 2012 11:49:25 +1200
From: [email protected]
To: [email protected]
Subject: [DUG] SqlDependency

 

I would like to get SQL Server (2008 R2) to notify my app when data in a table 
changes.

I’m looking for something like the SqlDependency class in .net, but for an XE2 
VCL (Pascal) app.

Does anyone know of a component, class, or way to replicate this (Not .net)?

 

Cheers,

Dave.

 

_______________________________________________ NZ Borland Developers Group - 
Delphi mailing list Post: [email protected] Admin: 
http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to 
[email protected] with Subject: unsubscribe


_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

 

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to