I have C# application that uses SQLDependency to get updates from a message table. I have tested it quite extensively and worked great in the development environment but when I ran it on the production server the server crashed. I can not be absolutely sure that it is this because we picked it up ~10 minutes after I ran the application.

From what I understand from how the SQLDependency works it uses stored procedures to interact with the service broker.

The errors I received

SQL Server must shut down in order to recover a database (database ID 1). The database is either a user database that could not be shut down or a system database. Restart SQL Server. If the database fails to recover after another startup, repair or restore the database.

Could not find an entry for table or index with partition ID 428869310480384 in database 2. This error can occur if a stored procedure references a dropped table, or metadata is corrupted. Drop and re-create the stored procedure, or execute DBCC CHECKDB.

We are running SQL Server 2005 SP1.

Edit:(removed code the link explains it better) I followed this example and mainly changed the query and what I do with the data.


  • 2
    I never had that kind of error with SqlDependencies. Does sounds like a different problem. You probably need to investigate further on that error message of yours.
    – UrbanEsc
    Oct 18, 2011 at 14:30
  • Can you provide some code or a summary of how you are wiring up the broker to your application?
    – davids
    Oct 18, 2011 at 14:32
  • Do you run DBCC CHECKDB on a regular maintenance schedule? (you should...) Oct 18, 2011 at 14:35
  • @MitchWheat Not that I am aware of, we do full db backups and transaction log backups though. I will have to go look.
    – fluf
    Oct 18, 2011 at 14:54
  • I did a DBCC CHECKDB on all of the databases and none returned with any errors. I did find that db 1 is the master database and db 2 is tempdb.
    – fluf
    Oct 18, 2011 at 15:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.