TRIGGER and ASSERTION sql server

Asked

Viewed 191 times

0

I would like to know how TRIGGERS and ASSERTIONS work I am beginner and I have no idea where to start?

  • 1

    Is there anything specific you want to know? See if it helps you: http://answall.com/q/164400/101 and http://answall.com/q/103700/101. SQL Server does not have SQL Server ASSERTATION.

  • If it is possible to do for each of the events of an INSERT, SELECT,UPDATE, DELETE table.

1 answer

0

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

The SELECT statement makes no changes to the database, so there is no trigger associated with this instruction.

In T-SQL there is still no CREATE ASSERTION. Depending on what you need, it can be simulated using table restriction (table Constraint) associated with user function.

On the web there are several articles available on using T-SQL triggers. You can browse the search results by "sql server Trigger". For example: Triggers in SQL Server: theory and practice applied 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.