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

Tracking retired products

As shown in the example from the video, Fresh Fruit Delivery needs to keep track of any retired products in a dedicated history table (RetiredProducts).

You are asked to create a new trigger that fires when rows are removed from the Products table.

The information about the removed rows will be saved into the RetiredProducts table.

Bu egzersiz

Building and Optimizing Triggers in SQL Server

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

Egzersiz talimatları

  • Create the TrackRetiredProducts trigger on the Products table.
  • Set the trigger to fire after rows are deleted from the table.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Create the trigger
CREATE ___ TrackRetiredProducts
ON ___
___ DELETE
AS
	INSERT INTO RetiredProducts (Product, Measure)
	SELECT Product, Measure
	FROM deleted;
Kodu Düzenle ve Çalıştır