# Trigger: iup_t200_trg

## Properties

Property | Value
--- | ---
Trigger | iup_t200_trg
ID | 1495676376
Owner | dbo
Schema | dbo
For Object | t200
Disabled |
Is Not For Replication |
Trigger Type Description | SQL TRIGGER
ANSI NULLS |
QUOTED IDENTIFIER |
Encrypted |
MS Shipped |
Execute As | Caller
Modify Date | 5/20/2011 7:49:17 PM
Creation Date | 5/20/2011 7:45:15 PM

## Extended Properties

No extended properties defined.

## Trigger Type

Is After Trigger | Is Instead Of | Insert Trigger | Update Trigger | Delete Trigger
--- | --- | --- | --- | ---

## First / Last Trigger

First Delete Trigger | First Insert Trigger | First Update Trigger | Last Delete Trigger | Last Insert Trigger | Last Update Trigger
--- | --- | --- | --- | --- | ---

## Objects that depend on [iup_t200_trg]

- iup_t200_trg

## Objects on which [iup_t200_trg] depends

- iup_t200_trg
  - dbo.t200
    - dbo.t300
    - updated

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE trigger iup_t200_trg on t200 instead of update as begin declare @d smalldatetime, @otherD smalldatetime declare @eventid int, @id int declare @c varchar(10) select @d = d, @eventid = eventid, @c = c from updated select @otherD = d from t300 where eventid = @eventid print @d print @c if @d > @otherD begin update t200 set c = @c where id = @id print 'ok' end else print 'not ok' end;

#### See also

List of Triggers