1. Learn
  2. /
  3. Courses
  4. /
  5. Building and Optimizing Triggers in SQL Server

Connected

Exercise

Preventing server changes

The company is also asking you to find a method to prevent databases from being mistakenly deleted by employees.

After a detailed analysis, you decide to use a trigger to fulfill the request.

The trigger will roll back any attempts to delete databases.

Instructions

100 XP
  • Create a new trigger called PreventDatabaseDelete.
  • Attach the trigger at the server level.