Insert Triggers and Inserting using OPENXML

  • If a table is getting inserted into via a stored procedure that inserts data using OPENXML, does the Table's Insert Trigger still fire or is it treated like bulk-insert?

    Thanks,

    Daniel

  • DanielP (2/26/2010)


    If a table is getting inserted into via a stored procedure that inserts data using OPENXML, does the Table's Insert Trigger still fire or is it treated like bulk-insert?

    Yes.

  • Paul White (2/26/2010)


    DanielP (2/26/2010)


    ... does the Table's Insert Trigger still fire or is it treated like bulk-insert?

    Yes.

    LOL 😀

    @daniel-2: to rephrase Pauls answer: it depends.

    You need to be a little more specific what the insert statement looks like...

    If the sproc will use OPENXML to get the data into a temp table, save it as a file and use bcp to load it into the target table, then it's like bulk insert. Not that I would do it that way nor have I ever seen code like that, but in theory it seems possible...

    Slightly off topic:

    You should look into XQuery instead of OPENXML. It's more powerful....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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