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
 General SQL Server Forums
 New to SQL Server Programming
 How can I write a query for notification request?

Author  Topic 

niren
Starting Member

18 Posts

Posted - 2013-06-21 : 05:40:31
This is my perivous question [url]http://stackoverflow.com/questions/17207550/how-to-push-the-data-from-database-to-application[/url] in stackoverflow about how to push the data from database instead of application pull data.

After went through the link http://rusanu.com/2006/06/17/the-mysterious-notification/ and the documents I come to know that I need to write a query in application side for notification request then the DB will register my request in subscription and If there is any change in the DB it will check subscription, if the request is there it will send the message to the client.

This para is from the above mentioned link

Along with the query submitted for the notification, the client submits a service name
and a broker instance. Each notification subscription begins a Service Broker dialog
with this provided service and broker instance. When data is changed and the change
would affect the result of the submitted query result, a message is sent on this
dialog. By sending this message, the client is considered notified and the notification
subscription is removed. If client desires to be notified on further changes, is
supposed to subscribe again.

Now I don't know how to write a query in application side for notification request and I don't under stand `submit a service and a broker instance` from the above given para. I guess the service and broker instance needs to be created in application before query the database for notification request. If it is so how to create service and a broker instance?

I can check the DB server for subscription by `select * from sys.dm_qn_subscriptions` command. can anyone help me?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-21 : 05:47:13
I think it speaks of using server broker feature

http://gavindraper.com/2012/06/03/sql-server-service-broker-explained/

which is exactly what James suggested you here

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=186141

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -