How to set up Triggers after SSIS dump.

  • Hello,

    I am would like for a Trigger to fire after an SSIS job finishes.

    My understanding is that i would use a AFTER trigger.

    I am confused by how my UPDATE and INSERT INTO would fire and only affect the new rows.

    SET ARITHABORT OFF

    SET ANSI_WARNINGS OFF

    UPDATE [GDev].[dbo].[tblCIDetailsTest]

    SET dFRate = (dFCharge/(dSCharge+dACharge))

    Also need to INSERT INTO 3 columns from a Table called tblFinanceP by looking up/Union or Join (not sure what to use) called vcTNum that is in bother the tblFinacneP and tblCIDetailsTest.

    INSERT INTO [GDev].[dbo].[tblCIDetailsTest] AS Details

    SELECT iPNum, iPCount, iZone

    FROM [GrEDI].[dbo].[tblFinanceP] AS EDI

    where EDI.vcTNum = GDev.dbo.tblCIDetailsTest.vcTN

    Thank You also if I am not on the correct track please fill free to give any imput. Thank You

  • btudek (5/11/2015)


    Hello,

    I am would like for a Trigger to fire after an SSIS job finishes.

    My understanding is that i would use a AFTER trigger.

    I am confused by how my UPDATE and INSERT INTO would fire and only affect the new rows.

    SET ARITHABORT OFF

    SET ANSI_WARNINGS OFF

    UPDATE [GDev].[dbo].[tblCIDetailsTest]

    SET dFRate = (dFCharge/(dSCharge+dACharge))

    Thank You

    You would know the rows affected by the ssis package by joining to a couple of

    tables that are within the trigger scope called the INSERTED and DELETED tables.

    You can google those terms for the msdn docs on it.

    However, this come across as a batch process?

    If so, you might be better off rolling the update in as part of the batch process.

    You could, for instance, set up another step in your job that executes the

    update statement when the ssis package run is complete.

    Also need to INSERT INTO 3 columns from a Table called tblFinanceP by looking up/Union or Join (not sure what to use) called vcTNum that is in bother the tblFinacneP and tblCIDetailsTest.

    INSERT INTO [GDev].[dbo].[tblCIDetailsTest] AS Details

    SELECT iPNum, iPCount, iZone

    FROM [GrEDI].[dbo].[tblFinanceP] AS EDI

    where EDI.vcTNum = GDev.dbo.tblCIDetailsTest.vcTN

    Thank You also if I am not on the correct track please fill free to give any imput.

    Looks to me like you need a simple inner join on this one.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply