TRIGGER INSERT :
create trigger [dbo].[trigger name] on [dbo].[table name 1st]
after INSERT
as
begin
insert into [IP Address destination server].[2nd database name].[dbo].[table name 2nd]
select [Material]
,[MaterialDescr]
,[MatlGroup]
,[Createdby] from inserted
end
TRIGGER DELETE :
create trigger [dbo].[trigger name] on [dbo].[table name 1st]
for DELETE
as
declare @ID varchar(15)
SET @ID = (select [Material] from deleted)
begin
delete from [IP Address destination server].[2nd database name].[dbo].[table name 2nd]
where MATERIAL = @ID
end
Comments
Post a Comment