Geeks With Blogs

My Techie Blog Knowledge Creation is Essential to Business, and Communication is Essential to Knowledge Creation

I was in the process of using SqlSiteMapProvider class today by jeff which is a new feature of ASP.NET 2.0 and i have always wanted to try this out
My main goal is to have a database driven site navigation interface with a securitytrimming feature which i know is possible

But after running the sql script to insert some sample tables to the DB and setting upt the project in VS 2005.
Ran F5 to run a sample page  and bingo error:

The SQL Server Service Broker for the current database is not enabled

After doing some search i saw a post that said you just have to run the below from query analyzer:

ALTER DATABASE DatabaseName SET ENABLE_BROKER;

But the query kept running for minutes and never stopped.So i taught there must be some conflicts.
So i started looking for a way to force the close off conflicting sessions.

So i ran
ALTER DATABASE DatabaseName SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
and then
ALTER DATABASE Databasename SET ENABLE_BROKER;

and then the query ran successfully

make sure you run:

SELECT is_broker_enabled FROM sys.databases WHERE name = 'DatabaseName'

to get the correct value : is_broker_enabled = 1

Hope that helps

 

Posted on Wednesday, October 15, 2008 6:18 PM Sql Server 2005 | Back to top


Comments on this post: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Thanks a lot for posting the solution, saved me a lot of time!
Left by Paul on Apr 24, 2009 7:14 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Thank you!
Left by Nelly on Jun 10, 2009 3:44 PM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
You are awesome.

That was really helpful.

Many Thanks.
Left by DotNetGuts on Aug 14, 2009 6:34 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Thank you very much. Its very kind of you to share this information.
Left by Jason Frain on Nov 12, 2009 1:00 PM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
thanks from my heart it's very helpfull
Left by snopbear on Nov 24, 2009 6:06 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Thanks a lot!!!
Finally someone who's answer is short and good!
g'day!
Left by Itay Blustein on Jan 13, 2010 6:46 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Cheers for the straight to the point post, saved me loads of time :)
Left by Magnus on Feb 05, 2010 4:40 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Very cool. Worked like a charm
Left by Better Gnomes and Gardens on Apr 07, 2010 4:27 PM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Thank you. It worked great and was quick and easy to follow.
Left by Ryan White on May 15, 2010 5:16 PM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
It's awesome. Thanks
Left by dumbo167 on Jun 14, 2010 1:25 PM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
You're a boss.
Left by someguy on Jul 29, 2011 7:35 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
Thanks worked great
Left by Steve on Aug 16, 2012 9:07 AM

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency
Requesting Gravatar...
I had the error message, but when I ran the Enable broker command it said it was already enabled. Your post to set the new broker did the trick.
Thanks - great work.
Left by Christine on Jan 22, 2014 9:56 PM

Your comment:
 (will show your gravatar)


Copyright © Patrick.O. Ige | Powered by: GeeksWithBlogs.net | Join free