BaşlayınÜcretsiz Başlayın

Preventing table deletion

Fresh Fruit Delivery wants to prevent its regular employees from deleting tables from the database.

Bu egzersiz

Building and Optimizing Triggers in SQL Server

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a new trigger, PreventTableDeletion, to prevent table deletion.
  • The trigger should roll back the firing statement, so the deletion does not happen.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Add a trigger to disable the removal of tables
CREATE TRIGGER ___
ON DATABASE
FOR ___
AS
	RAISERROR ('You are not allowed to remove tables from this database.', 16, 1);
    -- Revert the statement that removes the table
    ___;
Kodu Düzenle ve Çalıştır