Create trigger

xiaoxiao2021-03-06  77

Visual database tool

Create trigger

For the Microsoft® SQL ServerTM database, you can write the trigger in Transact-SQL, and for the Oracle database, you can write in PL / SQL. Create a trigger by specifying the following:

Current table or view (for the INSTEAD OF trip). Data Modify Transactions of the trigger: Add new data (INSERT), update existing data (update) or delete existing data. The trigger will take immediate operation after the specified transaction.

Create trigger

In Server Explorer, expand the "Table" folder. Right-click on the table name or view name you want to create a trigger. Select "New Trigger" in the shortcut menu. That is, a new demerifier with the main SQL statement is created in the source code editor: Create Trigger Authors_Trigger1

On dbo.authors

For / * Insert, Update, Delete * /

AS

/ * If update (colorn_name)... * / - or - create trigger titleview_trigger1

On dbo.titleview

INSTEAD OF / * INSERT, UPDATE, DELETE * /

AS

/ * If Update... * / Follow the steps shown below to modify the default trigger text:

The content to be replaced is replaced with the content Authors_trigger1 to assign the name / * INSERT, UPDATE, DELETE * / will activate the operation type / * if update (column_name) of the trigger... * /

Write the remaining trigger text in SQL.

See

Use trigger

转载请注明原文地址:https://www.9cbs.com/read-93884.html

New Post(0)