Previous Thread:   User Defined Aggregate

2/6/2006 11:34:05 AM    Re: SqlDependency and Notifications
You can receive anything you want -- you'll just have to set it up.  Profile  
  
your app while your query notifications are running and you'll see how it  
  
works; it's actually pretty simple.  The app uses WAITFOR to wait on the  
  
queue.  You could set this up yourself for any type of data or scenario.  
  
--  
  
Adam Machanic  
  
Pro SQL Server 2005, available now  
  
http://www.apress.com/book/bookDisplay.html?bID=457  
  
--  
  
"Leila" <Leilas@hotpop.com> wrote in message  
  
news:%23NvqJJzKGHA.3984@TK2MSFTNGP14.phx.gbl...



2/6/2006 2:36:33 PM    Re: SqlDependency and Notifications
You can't receive them as easily as you can the query notification.  For  
  
query notifications, there is a little program that runs on the server and  
  
listens for query notification messages on a Service Broker queue.  When it  
  
receives one, it opens a network connection to your client and sends a  
  
message which causes ADO.Net to call the callback function you specified.  
  
This only works for query notifications because the service only listens on  
  
the query notification queue and ADO.Net only handles query notification  
  
messages.  
  
If your application opens a normal database connection to the database on  
  
the server, it can WAITFOR messages on any queue it chooses to and receive  
  
messages sent to that queue,  These could be sent by triggers, DDL Event  
  
notifications, Trace Events, or any Service Broker application.  The trick  
  
here is you have to set up the Service Broker queues and Services and write  
  
the client application that listens for the Service Broker messages.  If you  
  
like, you can even listen for Query Notification events this way instead of  
  
using the ADO,Net listener.  
  
--  
  
This posting is provided "AS IS" with no warranties, and confers no rights.  
  
Use of included script samples are subject to the terms specified at  
  
http://www.microsoft.com/info/cpyright.htm  
  
"Leila" <Leilas@hotpop.com> wrote in message  
  
news:%23NvqJJzKGHA.3984@TK2MSFTNGP14.phx.gbl...

2/6/2006 7:00:32 PM    SqlDependency and Notifications
Hi,  
  
I have used SqlDependency to receive notifications when the data changes.  
  
But I would like to know if I can receive any other notification at the  
  
client which is sent from service broker. For example a trigger sends a  
  
message and particular client must receive that.  
  
Any help would be greatly appreciated.  
  
Leila

2/7/2006 9:03:39 AM    Re: SqlDependency and Notifications
Yes.  
  
--  
  
This posting is provided "AS IS" with no warranties, and confers no rights.  
  
Use of included script samples are subject to the terms specified at  
  
http://www.microsoft.com/info/cpyright.htm  
  
"Leila" <Leilas@hotpop.com> wrote in message  
  
news:%23FrQ%23b9KGHA.2012@TK2MSFTNGP14.phx.gbl...

2/7/2006 2:39:29 PM    Re: SqlDependency and Notifications
Thanks Roger!  
  
Does it mean that other Data Providers like ODBC and ADO 2.5 can receive  
  
these messages in the client?  
  
"Roger Wolter[MSFT]" <rwolter@online.microsoft.com> wrote in message  
  
news:%23lnWJ32KGHA.2012@TK2MSFTNGP14.phx.gbl...

2/10/2006 5:23:38 PM    Re: SqlDependency and Notifications
this is not quite correct. when the client asks for query notification, the  
  
sqlserver driver opens a network connection to the sqlserver, then waits for  
  
a response. the server does not open a connection to the client. this  
  
connection and its resources will remain open as long as the client is  
  
enlisted in query notifications.  
  
-- bruce (sqlwork.com)  
  
"Roger Wolter[MSFT]" <rwolter@online.microsoft.com> wrote in message  
  
news:%23lnWJ32KGHA.2012@TK2MSFTNGP14.phx.gbl...