============================
Exceptions faced
============================
e.g:- You are restoring database but You are having database with same name already in your sql then following Error may come :-
Error:Broker is not enabled
Reason:Restored the database on current db because of which same instances of db's have been created
sol:-
USE master
go
DECLARE @dbname sysname
SET @dbname = 'SelectDb'
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 SelectDb SET ENABLE_BROKER
Exceptions faced
============================
e.g:- You are restoring database but You are having database with same name already in your sql then following Error may come :-
Error:Broker is not enabled
Reason:Restored the database on current db because of which same instances of db's have been created
sol:-
USE master
go
DECLARE @dbname sysname
SET @dbname = 'SelectDb'
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 SelectDb SET ENABLE_BROKER
No comments:
Post a Comment