Stopping Database Deletion at Serer Level Using Trigger.

--This Trigger(DDL Triggger.Created at Server Level)stops deleting Database unexpectedly.
CREATE TRIGGER DontDeleteDatabase
ON ALL SERVER
AFTER DROP_DATABASE
AS
BEGIN
PRINT 'Are You sure you want to Delete this Database.To do so, Please disable the trigger and Try.'
ROLLBACK----This is very important if we forgot this.Databse will drop instantly.
END

Comments

Popular posts from this blog

Always On FailOver Events

The transaction log for database is full due to 'OLDEST_PAGE'

SSAS Cube or Database backup with Powershell command "Backup-AsDatabase"