I have to copy data from a database to another server on an insert of record in a table. I'm using a linked server for this. I have writen a sp to execute this. If I execute the sp manually, then the data is copied to the other server.If I use the same sp in a insert trigger, then it doesn't work. Any solutions for this ???Code of insert trigger :ALTER TRIGGER [Local_ProductionScheduleToMESS_Insert] ON [dbo].[Local_ProductionScheduleToMESS] AFTER INSERTAS Declare @ID intSelect @ID = PPS_ID from insertedExec spLocal_ProductionScheduleToMESS @ID
Code of sp :ALTER PROCEDURE [dbo].[spLocal_ProductionScheduleToMESS] @ID intAS--Send the Planned product run to MESSinsert into [mec_pri_02\mec_pri_02].Depal.dbo.tbl_ProficyProductSchedule (StartTime, EndTime, ProductionLine, ProcessOrder, Brandcode, Quantity, Status) select StartDate, EndDate, ProductionLine, ProcessOrder, Brandcode, Quantity, Status from dbo.Local_ProductionScheduleToMESS where PPS_ID = @ID