BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: How to monitor a database table from an external applica

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
quinn wildman
Guest





PostPosted: Sat Dec 27, 2003 1:14 am    Post subject: Re: How to monitor a database table from an external applica Reply with quote



References: <3fecb299 (AT) newsgroups (DOT) borland.com>
In-Reply-To: <3fecb299 (AT) newsgroups (DOT) borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 10.143.12.11
Message-ID: <3fecdcff$1 (AT) newsgroups (DOT) borland.com>
X-Trace: newsgroups.borland.com 1072487679 10.143.12.11 (26 Dec 2003 17:14:39 -0700)
Lines: 18
Path: internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!news.kiev.sovam.com!Svitonline.COM!news.adamant.net!info.elvisti.kiev.ua!news.donbass.net!newsgroups.borland.com!not-for-mail
Xref: intern1.nntp.aus1.giganews.com borland.public.delphi.database.sqlservers:103529

I would guess mssql has trigger and event alerters to do this. InterBase
does.

Khashayar IranParast wrote:

Quote:
How to monitor a database table from an external application
Hi all,
I'm writing a multi-user DB application using MSSQL. How can I monitor a
specific table from my application so that if a user updates the table, the
underlying code be able to notify the user and do something.
(The app. is written in delphi, I believe the problem is not bound to a
specific programming language).

Thanks.





Back to top
Bill Todd (TeamB)
Guest





PostPosted: Sat Dec 27, 2003 3:26 am    Post subject: Re: How to monitor a database table from an external applica Reply with quote



On Sat, 27 Dec 2003 04:53:11 +0330, "Khashayar IranParast"
<IranInPrison (AT) hotpop (DOT) com> wrote:

Quote:
but is it possible to
notify any connected user that a specific table has been changed?

The event alerters mentioned in Quinn's message are InterBase's tool
for letting the database notify a client application when data
changes. I don't think SQL Server has an equivalent mechanism but I
could be wrong.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Sat Dec 27, 2003 9:42 am    Post subject: Re: How to monitor a database table from an external applica Reply with quote



You may write Extended stored procedure and call it from trigger. Extended
stored procedure can broadcast a message to all running applications saying
that change has occured. You may also make some kind of registration for
notification and send notifications only to registered applications.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Bill Todd (TeamB)" <no (AT) no (DOT) com> ???????/???????? ? ???????? ?????????:
news:0tupuvg1d5bnqc8su0pccs28k6afvdqfa6 (AT) 4ax (DOT) com...
Quote:
On Sat, 27 Dec 2003 04:53:11 +0330, "Khashayar IranParast"
[email]IranInPrison (AT) hotpop (DOT) com[/email]> wrote:

but is it possible to
notify any connected user that a specific table has been changed?

The event alerters mentioned in Quinn's message are InterBase's tool
for letting the database notify a client application when data
changes. I don't think SQL Server has an equivalent mechanism but I
could be wrong.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)



Back to top
Bill Todd (TeamB)
Guest





PostPosted: Sat Dec 27, 2003 2:46 pm    Post subject: Re: How to monitor a database table from an external applica Reply with quote

Good point. If you write the notification system yourself anything is
possible. :)

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Back to top
Euan Garden
Guest





PostPosted: Sun Dec 28, 2003 11:46 pm    Post subject: Re: How to monitor a database table from an external applica Reply with quote

Its going to depend on how "real time" you want this solution to be.

If it needs to be transactional or real time then you really have to do
something from a trigger that calls outside of the SQL Server process, there
are a couple of variations on this. One is to write your own Extended
Storeed procedure (search this group on google for references on how to do
this) but writing XP's is not easy and can impact the reliability of the
system(in Yukon it is discouraged), so you could also just use one of the
built in XP's like xp_cmdshell but be aware that calling sync, potentially
blocking processes from inside a trigger can cause blocking and performance
problems.

The other option would be to have the trigger write a row into a
notifications table then use an external process to poll the notifications
table. This has the problem that polling is not real time and can cause perf
issues in its own right.

Not that it helps you but this is MUCH easier to write in Yukon(next version
of SQL Server).

-Euan

"Khashayar IranParast" <IranInPrison (AT) hotpop (DOT) com> wrote

Quote:
How to monitor a database table from an external application
Hi all,
I'm writing a multi-user DB application using MSSQL. How can I monitor a
specific table from my application so that if a user updates the table,
the
underlying code be able to notify the user and do something.
(The app. is written in delphi, I believe the problem is not bound to a
specific programming language).

Thanks.






Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.