Blocking SP in ms sql server.
Blocking SP in ms sql server.
GO
SET QUOTED_IDENTIFIER ON
GO
-- Send email
EXEC msdb.dbo.Sp_send_dbmail
@profile_name = 'Trendz_Email_Profile',
@body = @tableHTML,
@body_format = 'html',
@recipients = '[email protected]',
@subject = 'ALERT: (SP) Blocked Queries on EC2AMAZ-7VUVI7M';
-- Cleanup: Delete records older than 5 days
DELETE FROM dbo.PermanentBlockedQueries
WHERE LogDate < DATEADD(DAY, -5, GETDATE());
END
END
GO