SQL Server Developer Center > SQL Server Forums > SQL Service Broker > SqlDependency works perfect but sometimes...
Ask a questionAsk a question
 

AnswerSqlDependency works perfect but sometimes...

  • Wednesday, October 28, 2009 1:10 PMdevdre Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have a problem with the SqlDependency object.

    It appears to be working for days and suddenly it stops working for some reason. When I restart the NT service which is waiting for the data it works again for days...

    What is the possible reason?

    1. Running SQL Server 2005 SP2 (Can't install SP3 due to other db's).

Answers

  • Wednesday, October 28, 2009 5:21 PMBob BeaucheminMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Are you sure you're re-registering the query notification under all
    conditions you're application might run into? You can use the DMVs to query
    SQL Server as to status, or run a SQL Profiler trace to keep track of what
    QN is doing. If you only trace the QN events, it could be a fairly
    lightweight trace to run.

    Bob Beauchemin
    SQLskills

All Replies

  • Wednesday, October 28, 2009 5:21 PMBob BeaucheminMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Are you sure you're re-registering the query notification under all
    conditions you're application might run into? You can use the DMVs to query
    SQL Server as to status, or run a SQL Profiler trace to keep track of what
    QN is doing. If you only trace the QN events, it could be a fairly
    lightweight trace to run.

    Bob Beauchemin
    SQLskills