473,769 Members | 3,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2566
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.ht m

--
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.ht m

--
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
21453
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 for Col_1 and Col_2 are bit and Col_3 is char. I want to set a trigger on Col_2 to compare Col_1 to Col_2 when Col_2 is updated and if they're the same, set the value on Col_3 to "Completed". Can someone please help me? Thanks, Justin
11
3067
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 why is this a standard feature. Also is there anyway of seeing what triggers exsist and what they do? (psql \<somthing> or the like) Peter Childs ---------------------------(end of broadcast)---------------------------
3
6931
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 move over the icons in the taskbar the taskbar will immediately update itself and clear the old icon away. I was just wondering if this is normal or if I am supposed to "force" an update of the taskbar system tray icons somehow?
5
5618
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 and the database hasn't been updated then it's a huge mess. No problem right? Just document the changes to the database that you made and then send out a SQL script that will update the database with the program update right? Well, I don't...
7
6991
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 into the GUI because it is hard to describe in text. First of all what is the purpose of ALTOBJ()? This procedure was created mostly for ISVs who need to do produce change scripts to upgrade application from release to release, but it can also
3
2494
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 in that folder. But I would alway like to have the watch active. I don't want it at Form Load, and I can't have a button get clicked. I just would like to have when ever that file gets put in that folder, it performs my next step. I'll be...
53
4756
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, and .Net2005 code. I'm developing in vb.net 2005. This test sub just reads an input text file, writing out records to another text file, eliminating records that have a '99' in them (it is similar to a CSV file). Some of my concerns are:
0
10695
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 the Oracle compiler that tells it to do something. In this case you are telling Oracle to associate an error that you choose to a variable that you choose. This pragma must go in the declarative section of your block. Types of PRAGMA...
0
2491
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 table "employee" the trigger "tr_view_emp_iu" will not be executed. create or replace view view_employee as select e.emp_id, e.first_Name, e.last_name from employee e
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9979
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9849
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8861
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7393
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.