473,395 Members | 1,797 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,395 software developers and data experts.

Using trigger to notify an assembly of changes.


I have a requirement to create a sorted list of objects, stored within
an assembly, and I would like to use a After Insert/Update trigger to
notify that assembly that something has changed, rather than polling
the database for changes all the time.

My initial problem is that I need to create a static list so that it
can be dynamically looked at by other assemblies, but SQL Server won't
allow me to attach a dll which contains a static method.

Has anyone done something like this? Are there any decent examples
available anywhere?

any help will be appreciated.

simo

Oct 13 '06 #1
4 2552
On 12 Oct 2006 19:31:52 -0700, simo wrote:
>
I have a requirement to create a sorted list of objects, stored within
an assembly, and I would like to use a After Insert/Update trigger to
notify that assembly that something has changed, rather than polling
the database for changes all the time.

My initial problem is that I need to create a static list so that it
can be dynamically looked at by other assemblies, but SQL Server won't
allow me to attach a dll which contains a static method.

Has anyone done something like this? Are there any decent examples
available anywhere?

any help will be appreciated.
Hi simo,

Not a direct reply to your question - but have you looked into using
Query Notifications rather than using triggers to roll your own
notification solution? Query Notifications are designed specifically to
notify front-end applications when the result of a query has changed.
Note that Query Notifications work only on SQL Server 2005.

Here's a link to the relevant documentation in Books Online:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/06b1c6fa-3024-4425-bd99-64b6d3c80267.htm

--
Hugo Kornelis, SQL Server MVP
Oct 13 '06 #2
Not a direct reply to your question - but have you looked into using
Query Notifications rather than using triggers to roll your own
notification solution? Query Notifications are designed specifically to
notify front-end applications when the result of a query has changed.
Note that Query Notifications work only on SQL Server 2005.

Here's a link to the relevant documentation in Books Online:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/06b1c6fa-3024-4425-bd99-64b6d3c80267.htm

--
Hugo Kornelis, SQL Server MVP
Thanks for that Hugo,
The Query Notifications stuff is pretty cool and I have implemented it
and got it working - all very impressive.
I'm actually using it in a service object to check the status of
records in a specific table waiting to be updated by the UI. Where
the guy who has written the Web Front End is polling the database to
find out when my service has updated the status - but the web front end
is consuming about 30% CPU resources and the Query Notification is
using no noticable resources - so he might be doing the same thing
next.

My only problem was that the MS documentation for this was very
detailed about the internals of how all this works, but completely
lacked any useable examples - but we have google and found a few
examples that were quite good.

the best I found was at code magazine by julia lerman.
http://www.code-magazine.com/Article...uickid=0605061

Cheers

simo

Oct 17 '06 #3
On 17 Oct 2006 17:00:00 -0700, simo wrote:

(snip)
>My only problem was that the MS documentation for this was very
detailed about the internals of how all this works, but completely
lacked any useable examples - but we have google and found a few
examples that were quite good.
Hi simo,

(Sorry for the late reply)

Thanks for the feedback. I will make sure that folks from Microsoft get
to see your message.

I have no personal experience implementing Query Notifications, so I
can't make any further comments on this issue.

--
Hugo Kornelis, SQL Server MVP
Oct 22 '06 #4
On Sun, 22 Oct 2006 23:26:53 +0200, Hugo Kornelis wrote:
>On 17 Oct 2006 17:00:00 -0700, simo wrote:

(snip)
>>My only problem was that the MS documentation for this was very
detailed about the internals of how all this works, but completely
lacked any useable examples - but we have google and found a few
examples that were quite good.

Hi simo,

(Sorry for the late reply)

Thanks for the feedback. I will make sure that folks from Microsoft get
to see your message.
Hi simo,

Here's the reply I've gotten from Microsoft:
>We are aware of the lack of examples in the QN documentation. There is an
existing doc bug to fix this, but I don't know at this time when that bug
will be resolved.

--
Hugo Kornelis, SQL Server MVP
Oct 25 '06 #5

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

Similar topics

7
by: Justin | last post by:
I am extremely new at SQL Server2000 and t-sql and I'm looking to create a simple trigger. For explanation sake, let's say I have 3 columns in one table ... Col_1, Col_2 and Col_3. The data type...
11
by: Peter Childs | last post by:
Is it possible to deferr a trigger until commit, Or to have the trigger not occur if the transaction is rolled back? Like transaction. I think its possible since constraints use triggers and if so...
3
by: jm | last post by:
Hi, I have a C# program that changes the notifyIcon during the program. What I have noticed is that sometimes when the program is over the old icon will still be in the system tray. But when i...
5
by: keith.culpepper | last post by:
Can anyone please provide some assistance with a trigger that I need to develop. Here is the situation: Our program updates depend on database updates. If a client receives the program update...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
3
by: Rudy | last post by:
Hello all! This is what I want to do, looking the for the best way to do this. I have a text file that gets created and placed in a folder. I would like to have a watch for that file when it pops...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
0
debasisdas
by: debasisdas | last post by:
PRAGMA:-Signifies that the statement is a pragma (compiler directive). Pragmas are processed at compile time, not at run time. They pass information to the compiler. A pragma is an instruction to...
0
by: marieoutayek | last post by:
Hi, I have a problem and I hope that you help me : I have a trigger "tr_view_emp_iu" INSTEAD OF a view "view_employee" the problem is if the changes is done on the field "first_name" in the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.