トリガーの削除と変更

SQL Server のトリガー構築と最適化

Florin Angelescu

Instructor

テーブル/ビュー トリガーの削除

DROP TRIGGER PreventNewDiscounts;

テーブル

SQL Server のトリガー構築と最適化

データベース トリガーの削除

DROP TRIGGER PreventNewDiscounts;
DROP TRIGGER PreventViewsModifications
ON DATABASE;

テーブル

データベース

SQL Server のトリガー構築と最適化

サーバー トリガーの削除

DROP TRIGGER PreventNewDiscounts;
DROP TRIGGER PreventViewsModifications
ON DATABASE;
DROP TRIGGER DisallowLinkedServers
ON ALL SERVER;

テーブル

データベース

サーバー

SQL Server のトリガー構築と最適化

トリガーの無効化

DISABLE TRIGGER PreventNewDiscounts
ON Discounts;
DISABLE TRIGGER PreventViewsModifications
ON DATABASE;
DISABLE TRIGGER DisallowLinkedServers
ON ALL SERVER;

テーブル

データベース

サーバー

SQL Server のトリガー構築と最適化

トリガーの有効化

ENABLE TRIGGER PreventNewDiscounts
ON Discounts;
ENABLE TRIGGER PreventViewsModifications
ON DATABASE;
ENABLE TRIGGER DisallowLinkedServers
ON ALL SERVER;

テーブル

データベース

サーバー

SQL Server のトリガー構築と最適化

トリガーの変更

CREATE TRIGGER PreventDiscountsDelete
ON Discounts
INSTEAD OF DELETE
AS
    PRINT 'You are not allowed to data from the Discounts table.';
DROP TRIGGER PreventDiscountsDelete;
CREATE TRIGGER PreventDiscountsDelete
ON Discounts
INSTEAD OF DELETE
AS
    PRINT 'You are not allowed to remove data from the Discounts table.';
SQL Server のトリガー構築と最適化

トリガーの変更

CREATE TRIGGER PreventDiscountsDelete
ON Discounts
INSTEAD OF DELETE
AS
    PRINT 'You are not allowed to data from the Discounts table.';
ALTER TRIGGER PreventDiscountsDelete
ON Discounts
INSTEAD OF DELETE
AS
    PRINT 'You are not allowed to remove data from the Discounts table.';
SQL Server のトリガー構築と最適化

Ayo berlatih!

SQL Server のトリガー構築と最適化

Preparing Video For Download...