CREATE TRIGGER [tri_TABLE1_INS] ON [TABLE1]
FOR INSERT
AS
INSERT INTO TABLE1_LOG
SELECT 'INS', GETDATE(), * FROM INSERTED
GO
CREATE TRIGGER [tri_TABLE1_UPD] ON [TABLE1]
FOR UPDATE
AS
INSERT INTO TABLE1_LOG
SELECT 'UPD', GETDATE(), * FROM INSERTED
GO
CREATE TRIGGER [tri_TABLE1_DEL] ON [TABLE1]
FOR DELETE
AS
INSERT INTO TABLE1_LOG
SELECT 'DEL', GETDATE(), * FROM DELETED
GO
2009年9月2日 星期三
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言