Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Firing trigger on a bulk like insert

Firing trigger on a bulk like insert

Scheduled Pinned Locked Moved Database
databasecomxmlhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    www Developerof NET
    wrote on last edited by
    #1

    Hi all, I have implemented a functionality shown here[^] on codeproject. This method generates xml from ntext and inserts it into table. Now i want a trigger on this table which inserts in other table when each row is inserted.But the problem is that when the trigger fires, the inserted table contains all the rows that are inserted in the table (i guess since it was inserted all at once) and hence i m not able to insert it in other table bcas i have to perform some operation on the data also. Is there a method so that the trigger fires for each row and not all at once????

    When you fail to plan, you are planning to fail.

    M 1 Reply Last reply
    0
    • W www Developerof NET

      Hi all, I have implemented a functionality shown here[^] on codeproject. This method generates xml from ntext and inserts it into table. Now i want a trigger on this table which inserts in other table when each row is inserted.But the problem is that when the trigger fires, the inserted table contains all the rows that are inserted in the table (i guess since it was inserted all at once) and hence i m not able to insert it in other table bcas i have to perform some operation on the data also. Is there a method so that the trigger fires for each row and not all at once????

      When you fail to plan, you are planning to fail.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      I have not used openxml so I am assuming a bulk insert is used and the trigger is by passed (I also never, ever use triggers). So why not grab the Details ID, insert the records, get the last ID inserted, call a proc for the detail between. Ugly and subject to other user interference. OR Don't use openxml - I am surprised the insert does not fire the insert trigger

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups