Showing posts with label notification. Show all posts
Showing posts with label notification. Show all posts

Friday, February 10, 2012

Change Notification needed in .NET

Hi,
Think I want an application (say in C#) that would say "Hello" when a
particular table in the database get 100 rows. For this I could use a
thread that would check the rowcount in every say 1 minute. But the
problem is 1 minute is too much for an interactive application. I can
use lower time interval but it would increase database activity.
Suppose rowcount cross 100 mark once or twice in a month but need to be
responded immediately. Worst 10000 pepole want "Hello" in their
application. Then all client application would be checking it and
hence increasing network traffic and database activity.
Is there any way in SQL Server 2005 that would enable us to get events
in .NET applications? In older SQL Server versions?
Thanks
MukeshYou might want to look into the "Query Notification" concept in 2005. You'd
get notified when a
modification in the table has been don in a way that the result of a query h
as changed, and it is
without polling. Not sure it would be the best thing here, but worth looking
into.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mukesh" <cmukesh19@.gmail.com> wrote in message
news:1148729766.229925.191570@.j73g2000cwa.googlegroups.com...
> Hi,
> Think I want an application (say in C#) that would say "Hello" when a
> particular table in the database get 100 rows. For this I could use a
> thread that would check the rowcount in every say 1 minute. But the
> problem is 1 minute is too much for an interactive application. I can
> use lower time interval but it would increase database activity.
> Suppose rowcount cross 100 mark once or twice in a month but need to be
> responded immediately. Worst 10000 pepole want "Hello" in their
> application. Then all client application would be checking it and
> hence increasing network traffic and database activity.
> Is there any way in SQL Server 2005 that would enable us to get events
> in .NET applications? In older SQL Server versions?
> Thanks
> Mukesh
>|||In older versions of SQL Server you could have a trigger that calls
XP_LOGEVENT. Then you can use an NT Event Log hook to get your
notification. I know Microsoft has some examples of hooking the Event Log
on their web site. I had some code lying around in java script that did
this, but can't find it at the moment.
"Mukesh" <cmukesh19@.gmail.com> wrote in message
news:1148729766.229925.191570@.j73g2000cwa.googlegroups.com...
> Hi,
> Think I want an application (say in C#) that would say "Hello" when a
> particular table in the database get 100 rows. For this I could use a
> thread that would check the rowcount in every say 1 minute. But the
> problem is 1 minute is too much for an interactive application. I can
> use lower time interval but it would increase database activity.
> Suppose rowcount cross 100 mark once or twice in a month but need to be
> responded immediately. Worst 10000 pepole want "Hello" in their
> application. Then all client application would be checking it and
> hence increasing network traffic and database activity.
> Is there any way in SQL Server 2005 that would enable us to get events
> in .NET applications? In older SQL Server versions?
> Thanks
> Mukesh
>