Seboko
04-25-2006, 06:16 AM
I want a trigger to update the fields: field1, field2 and field3 of NewTable
whenever the same fields are updated in OldTable.
CREATE TRIGGER UpdateNewTable ON dbo.OldTable
after UPDATE
AS
Begin
update NewTable set
field1 = Inserted.field1,
field2 = Inserted.field2,
field3= Inserted.field3
where Id = Inserted.Id
End
But I get a message that "The column prefix 'Inserted' does not match with a table name".
Please help
whenever the same fields are updated in OldTable.
CREATE TRIGGER UpdateNewTable ON dbo.OldTable
after UPDATE
AS
Begin
update NewTable set
field1 = Inserted.field1,
field2 = Inserted.field2,
field3= Inserted.field3
where Id = Inserted.Id
End
But I get a message that "The column prefix 'Inserted' does not match with a table name".
Please help