Errors with SqlQueryNotificationStoredProcedure filled up Sql Server log

 select * from sys.service_queues


ALTER AUTHORIZATION ON DATABASE::<dbname> TO [sa];

ALTER DATABASE <DBNAME> SET DISABLE_BROKER
ALTER DATABASE <DBNAME> SET NEW_BROKER
ALTER DATABASE <DBNAME> SET ENABLE_BROKER

Drop only SqlQueryNotificationStoredProcedure SPs:


use <your DB name>;
declare @procName varchar(500)
declare cur cursor 

for select [name] from sys.objects WHERE type in (N'P', N'PC') and name like 'SqlQueryNotificationStoredProcedure%'
open cur
fetch next from cur into @procName
while @@fetch_status = 0
begin
exec ('drop procedure [' + @procName+']')
fetch next from cur into @procName
end
close cur
deallocate cur

Comments