SQL Server triggers

Source: Internet
Author: User

Trigger Name:

DML triggers: Refers to triggers that are enabled when a DML event occurs in the database. A DML event is an INSERT, UPDATE, delete that modifies data in a table or view.

DDL triggers: is enabled when a DDL event occurs in a server or database. DDL events refer to create, alter, and drop in a table or index.

SQL Server creates two dedicated tables for each trigger: the inserted table and the deleted table.

The deleted table holds all rows that are to be removed from the table because of execution of the DELETE or UPDATE statement.

The inserted table holds all rows to be inserted into the table because of an INSERT or UPDATE statement execution.

Trigger type: For: Trigger After, after: Trigger, instead of: Before Trigger

Grammar:

Create TRIGGER Trigger Name

On table name

With Encrypion encryption trigger

For Action name (note: Operation name refers to update, delete, insert)

As

T-SQL statements

Instance:

Https://www.sogou.com/link?url=hedJjaC291P3yGwc7N55kLSc2ls_Ks2xs0qN495o-tR4P167f5IBaUazEuN15L4w6B8cvC6557s4d2X6F0SQYA.

Actions for triggers:

http://blog.csdn.net/tianwailaibin/article/details/8111766

SQL Server triggers

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.