5> CREATE TABLE DateTable(
6> ID int NOT NULL IDENTITY (1, 1)
7> PRIMARY KEY,
8> Txt char (10) NOT NULL,
9> EntryDate datetime NOT NULL
10> )
11> GO
1> CREATE TRIGGER t_DateTable ON DateTable AFTER INSERT, UPDATE
2> AS
3> IF @@ROWCOUNT = 0
4> RETURN
5> IF UPDATE (EntryDate)
6> UPDATE D
7> SET
8> EntryDate = CONVERT (char (10), I.EntryDate, 112)
9> FROM
10> inserted I
11> JOIN
12> DateTable D ON D.ID = I.ID
13> GO
1>
2> drop trigger t_DateTable
3> drop table dateTable
4> GO