The SQL Server Service Broker for the Current Database is not Enabled, and as a Result Query Notifications are not Supported. Please Enable the Service Broker for this Database

Start SQL Server and write this query to enable broker.

ALTER DATABASE Demo SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
To check weather broker is enable or not run this query.

SELECT is_broker_enabled FROM sys.databases WHERE name = ‘Demo’

To kill all the database running process, write this query.

USE master

go

DECLARE @dbname sysname

SET @dbname = ‘Demo’

DECLARE @spid int

SELECT @spid = min(spid) from master.dbo.sysprocesses where dbid = db_id(@dbname)

WHILE @spid IS NOT NULL

BEGIN

EXECUTE (‘KILL ‘ + @spid)

SELECT @spid = min(spid) from master.dbo.sysprocesses where dbid = db_id(@dbname) AND spid > @spid

END

ALTER DATABASE @dbname SET ENABLE_BROKER

NoteDemo is my database name.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s