Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    India
    Posts
    1

    Question Unanswered: Which one is better Trigger Or Stored Procedure

    I have a half-million records.. which get inserted using bulk insert.

    There are few fields which i need to update form different table.
    Which approch will be most efficient. A trigger which will fire at bulk insert or a stored procedure which will be fired after all rows got updated.

  2. #2
    Join Date
    Oct 2003
    Location
    Pune
    Posts
    59
    I think the stored procedure is the better option as u can execute it as and when u want.
    But if u want it to be called upon the updation then trigger will be better option

    It depends on what is ur need.
    Whether u want do it manualy or automatically
    Cyrus
    Finding ways for solution

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322

    Re: Which one is better Trigger Or Stored Procedure

    Originally posted by pranavvk
    I have a half-million records.. which get inserted using bulk insert.

    There are few fields which i need to update form different table.
    Which approch will be most efficient. A trigger which will fire at bulk insert or a stored procedure which will be fired after all rows got updated.
    Have your cake and eat it too...

    CREATE a TRIGGER to keep your data integrity... (Or create RI)

    And don't specify FIRE_TRIGGER on the bulk INSERT...update with a sproc...I would think it would NOT be a good idea to fire a trigger against 1 million rows on load...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •