1. Trang chủ
  2. » Tất cả

Slide5

32 133 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Session 5Introducing to Triggers ReviewIn preview session, we learnt:Stored ProceduresDefine Stored ProceduresTypes of Stored ProceduresCreate and Execute Stored ProceduresViewing InformationModifying and Dropping Stored ProceduresWorking with Stored Procedures Session objectivesIntroduce to TriggersCreate DML TriggersWorking with DML TriggersModifying definitions of DML triggers Introduce to TriggersIs stored procedure that is executed when modify data in tableIs defined on the INSERT, UPDATE, DELETE action on a tableUse of triggers: Sample triggerAllenBrianCathyDerekGregMarkCarlKathyDerek Sample triggerAllenBrianCathyDerekGregMarkCarlKathyTrigger FiredDerekInserted Types of TriggersTrigger in SQL Server 2005 can be classified:Data Manipulation Language (DML) TriggersData Definition Language (DDL) TriggersLogon Triggers DML TriggersAre executed when DML events occur in tables or viewsDML Triggers are of three main types:INSERT triggerUPDATE triggerDELETE trigger Introduction to Inserted and Deleted Tables•Insert table contains copies of records that are modified with the INSERT and UPDATE operations on the trigger table.•Deleted table contains copies of records that are modified with the DELETE and UPDATE operations on the trigger table Create triggersCREATE TRIGGER statement uses to create trigger. Syntax:CREATE TRIGGER Trigger_nameON tableFOR [DELETE, INSERT, UPDATE][WITH ENCRYPTION]AS Sql_statements 123doc.vn

Ngày đăng: 12/01/2013, 15:42

Xem thêm

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN