Sample Trigger
CREATE TABLE dbo.Test (
item varchar(50)
)
GO
CREATE TABLE dbo.Test1 (
item varchar(50)
)
GO
Alter TRIGGER InsertEntry ON dbo.Test AFTER INSERT,UPDATE AS
DECLARE @item int
IF EXISTS(SELECT item FROM inserted)
BEGIN
DECLARE @msg varchar(500)
SET @msg = (SELECT item FROM inserted)
insert into test1 values(@msg)
END
GO
No comments:
Post a Comment