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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How can I write a query for notification request?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

18 Posts

Posted - 06/21/2013 :  05:40:31  Show Profile  Reply with Quote
This is my perivous question in stackoverflow about how to push the data from database instead of application pull data.

After went through the link 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?

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 06/21/2013 :  05:47:13  Show Profile  Reply with Quote
I think it speaks of using server broker feature

which is exactly what James suggested you here

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000