kreta/Kreta.DataAccess.Migrations/Scripts/20220621084202_DB_4633_2/00_stop_queue.sql
2024-03-13 00:33:46 +01:00

23 lines
No EOL
534 B
Transact-SQL

while (select count(*) from auditlog.AuditQueue with (nolock)) > 0
begin
raiserror('Waiting for empty AuditQueue...', 0, 0) with nowait;
waitfor delay '00:00:05';
end
go
ALTER QUEUE [auditlog].[AuditQueue]
WITH
STATUS = OFF,
RETENTION = OFF,
ACTIVATION (
STATUS = OFF,
PROCEDURE_NAME = [auditlog].[usp_AuditProcessing],
MAX_QUEUE_READERS = 1,
EXECUTE AS N'kreta_tech_user'
),
POISON_MESSAGE_HANDLING (STATUS = ON)
GO
TRUNCATE TABLE auditlog.DialogPool
GO