Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Service Broker (2005)
 Query Notification

Author  Topic 

miztaken
Starting Member

2 Posts

Posted - 2007-05-23 : 05:48:45
Hi,
I am using .net 2.0 and sql server 2005.
I have one table in SQLSERVER 05, I want to notify user Application (C# Application)when changes are made on that table depending upon the condition.
For Example: if tbl1 be any table and when insert operation is carried out in that table.
Then after 100 or multiple of 100 record insertion in tbl1 i want the notification to be given to user Application (C# Application).
Is this possible through Query Notification.?
Please Help

Dallr
Yak Posting Veteran

87 Posts

Posted - 2007-05-23 : 07:48:55
I am thinking this might be better done in the front end... but i stand to be corrected.

Try somethng like:
On after insert in the front end check to see if the total count of the records in the table divided by 100 is odd or even. If it is odd it is not in multiples of 100 if it is even then it is.

Dallr
Go to Top of Page

miztaken
Starting Member

2 Posts

Posted - 2007-05-23 : 08:13:58
But this will add additional overhead.

And by the way what is Query Notification(Notification Services) meant for ?
Can this type of problem be solved using it ?

I have previously tried to use SQLDependency() but there is a limitation in the command (i.e. query) provided to it.

I am confused here.

Is this a solvable problem..?


miztaken
Go to Top of Page

tflorest
Starting Member

3 Posts

Posted - 2007-08-08 : 11:41:39
Check Books Online for DML triggers. An AFTER INSERT trigger should do it for you. However, it will require a bit of coding.

Good Luck,

Tcharly Florestal
Go to Top of Page
   

- Advertisement -