473,216 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

Notifying multiple applications of table update

Hello,

I am writing an application using Visual Studio .NET (C#). The
application will be run on several workstations simultaneously, and
all of them will be accessing a single sql server database. I am
trying to have it so that when one of the applications updates the
fields of a table in the database, all of the other applications are
notified (Without polling the DB).

I have been trying to do this by using a SQL Trigger and calling
RaisError from within. This will create an exception for the calling
application (what i wanted), but I can get any of the other
applications to see the error.

Is there a way of accomplishing this using triggers? Is there another
way of notifying all applications of a database change without the use
of polling?

James Chang
ja*********@quest.com.au
Jul 20 '05 #1
1 3949
[posted and mailed, please reply in news]

James Chang (ja*********@quest.com.au) writes:
I am writing an application using Visual Studio .NET (C#). The
application will be run on several workstations simultaneously, and
all of them will be accessing a single sql server database. I am
trying to have it so that when one of the applications updates the
fields of a table in the database, all of the other applications are
notified (Without polling the DB).

I have been trying to do this by using a SQL Trigger and calling
RaisError from within. This will create an exception for the calling
application (what i wanted), but I can get any of the other
applications to see the error.

Is there a way of accomplishing this using triggers? Is there another
way of notifying all applications of a database change without the use
of polling?


You will somehow have to signal to the clients that something has
happened. This is far from a trivial endeavour. You must either write
an extended stored procedure for the task, or write a COM object that
you communicate with the sp_OAmehotds. In either case, you need to
test what your write very carefully, because if you get an execution
error in the code you write, you can bring down the entire SQL Server.

Furthermore, if you actually take the task to signal the other
clients from the XP/COM-object directly, then you will prolong the
execution time for the trigger considerably, and this will have an
impact on concurrency in the system. So, in practice you should
just leave a quick note that does not require acknowledgement, and
then you have an other process which reads these notes, and signals
the processes.

You may also take a look at SQL Server Notification Services, (see
www.microsoft.com/sql) and see if this is something can meet your
needs.

In the end you may find that polling is the simplest, safeest and the
most robust method for you to use.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RJ | last post by:
We currently send product releases to our customers, and often have to include scripts that need to be ran on the Oracle databases (also do it for SqlServer customers, but we use a different set of...
6
by: Steven An | last post by:
Howdy, I need to write an update query with multiple aggregate functions. Here is an example: UPDATE t SET t.a = ( select avg(f.q) from dbo.foo f where f.p = t.y ), t.b = ( select sum(f.q)...
2
by: news.hp.com | last post by:
I have situation where I need to copy multiple records (only certain fields) from a Rules table to an Events table based on a selection identified in a combo box. When the selection is made in a...
2
by: Craig M | last post by:
Hi, I have a form, frmInvoices and a subform, frmInvoicesSub. On the parent form, i have a "print report" button, that prints a report depending on an ID on the parent form. Each record in...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
0
by: Thom Little | last post by:
I need to have multiple applications in the same 2.0 webspace. I am using the add-in to Visual Studio 2005 that permits me to do this and it creates namespaces in a manner very similar to 1.1 in...
1
by: projectjakecs | last post by:
Hi, I am working on a ms access database and I am having trouble using a form to create new records in an associative table. Here is the breakdown of my database: Main Table - Computer...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.