Problem with triggers

  • Hello everyone,

    I have a problem running a INSERT INSTEAD OF trigger from my stag server to development server. Let me explain the step

    1.Live server updates the stag server by first truncating all the date in a stag server table and performs BULK insert using DTS Package

    2. This runs as a sql job everyday from the Live server

    During this process, INSTEAD OF trigger that update my development server is not getting fired.

    I assume this is probably because from where the insert statement is executed to insert bulk data in to the stag server.

    could some one share their experience here..

    Ta

  • Assuming you are using BULK INSERT or BCP to do the bulk load, then have a look at BOL.

    This is what it has to say about BULK INSERT

    FIRE_TRIGGERS

    Specifies that any insert triggers defined on the destination table execute during the bulk-import operation. If triggers are defined for INSERT operations on the target table, they are fired for every completed batch.

    If FIRE_TRIGGERS is not specified, no insert triggers execute.

  • I will look in to BOL then update the post

  • Hi yeh,

    This bulk operation is carried out using following statement in DTS package.

    select fields from table.

    This statment performs bulk insertion and Im not sure how to set fire trigger on.

    Can some one help.

    Ta

  • I'm not sure it's possible.

    Unless somebody else knows of a way, you may have to resort to bulk inserting the data into a staging table, and then insert the data into the real table as a second task.

  • yes that what I figured it out as well. I will need to use BCP or Bulk Insert instead of DTS PACKAGE. According to my knowledge Bulk insert will provide greater performance..

    Appreciate your time and effort.

    ta

  • Hi

    If you do loading with SSIS then check out this solution:

    http://www.sqlservercentral.com/Forums/Topic676422-146-1.aspx#bm677555

    Regards,

    René

  • Rene. May be in future we might use SSIS for ETL but as of now we will be using BCp or BULK Insert. I will go through the link .

    Thank you

Viewing 8 posts - 1 through 7 (of 7 total)

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