TRIGGER and ASSERTION sql server

0

I'd like to know how TRIGGERS and ASSERTIONS work I'm a beginner and I have no idea where to start?

    
asked by anonymous 07.12.2016 / 21:58

1 answer

0

The trigger creation syntax allows you to create independent procedures for the INSERT, UPDATE, and DELETE statements. It is also possible in a single procedure to handle all three event types. Details in the documentation for creating triggers: CREATE TRIGGER .

The SELECT statement does not make any changes to the database, so there is no trigger associated with this statement.

In T-SQL there is still no CREATE ASSERTION. Depending on what you need, it can be simulated with the use of table constraint associated with the user function.

On the web there are several articles available on the use of triggers in T-SQL. You can search the search results for " sql server trigger ". For example: Triggers in SQL Server: Theory and applied practice in a real situation .

In the book " Inside Microsoft SQL Server 2008: T-SQL Programming " , by Itzik Ben-Gan, Chapter 4 is dedicated to triggers.

    
08.12.2016 / 11:29