Hii to all,
I have a requirement that i need to migrate a table data from one database to a table present in another database,i.e when ever any DML operation is performed
on source table(mainlog) that should be reflect to target table(sparelog)present in another database,for this i wrote a trigger like below
CREATE TRIGGER [dbo].[UpdateLogRecords]
ON [dbo].[employee] FOR UPDATE
AS
BEGIN
UPDATE employeedummy SET first_name=(SELECT inserted.first_name FROM inserted)
WHERE employeedummy.id in (SELECT inserted.ID from inserted)
END
Go to the complete details ...