TAILIEUCHUNG - Types of Triggers

Sau khi kích hoạt được thực hiện sau khi các hành động của INSERT, UPDATE, hoặc DELETE tuyên bố được thực hiện. Quy định cụ thể sau khi là tương tự như quy định cụ thể CHO, đó là lựa chọn duy nhất có sẵn trong các phiên bản trước đó của SQL Server. Sau khi kích hoạt có thể chỉ được xác định trên bàn. | Types of Triggers AFTER Triggers After triggers are executed after the action of the INSERT UPDATE or DELETE statement is performed. Specifying AFTER is the same as specifying FOR which is the only option available in earlier versions of SQL Server. AFTER triggers can be specified only on tables. INSTEAD OF Triggers INSTEAD OF triggers are executed in place of the usual triggering action. INSTEAD OF triggers can also be defined on views with one or more base tables where they can extend the types of updates a view can support. INSTEAD OF triggers give you the ability to evaluate the changes that would have taken place if the data modification statement had actually executed. Like AFTER triggers each INSTEAD OF trigger gives you access to two virtual tables called Inserted and Deleted. For a DELETE trigger the virtual table Deleted holds all the deleted rows and for an INSERT trigger the virtual table Inserted holds all the new rows. For INSTEAD OF triggers the Deleted table holds the rows that would have been deleted and the Inserted table holds the rows that would have been inserted had the modification taken place. An UPDATE trigger populates both the Inserted and Deleted tables the Deleted table stores the old version of the rows and the Inserted table stores the new version. With all triggers the Inserted and Deleted tables change their structure to reflect the columns and data types of the table the trigger is attached to. For example if you have a trigger on the Titles table in the Pubs database the Inserted and Deleted tables will have the same columns as the Titles table with the same names and data types. Table compares an INSTEAD OF trigger with an AFTER trigger. Following is a simple example. Suppose you want to make sure that when someone updates any prices in the Titles table in the Pubs database the change is no more than 10 percent of the original price. You need to look at both the old price value and the new value to see whether the change is

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.