Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

disable database droping sql

CREATE OR ALTER TRIGGER TRG_PreventDropProductionDB ON ALL SERVER
FOR DROP_DATABASE
AS
BEGIN
    IF DB_NAME() = 'ProductionDatabase'
        BEGIN
            RAISERROR('You cannot drop the production database.', 16,1);
            ROLLBACK;
        END
END
GO
Source by dba.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #disable #database #droping #sql
ADD COMMENT
Topic
Name
2+9 =