invoke trigger 1'000'000 times?

  • Hi all, here is a little example for my situation:

    At the beginning there is a "statistic" table with 1'000'000 lines. Every day there are new lines... To stop the daily increase now there is a second database, which is filled by a trigger from our statistics table. The trigger also calculates some other stuff and writes it to the second database. Every night the statistics table will by cleaned...

    But now I want to update some old databases. So I don't start at day 0, the tables are full - for example 1'000'000 lines. What's the fastes way t oget all to the second database? Are there options to turn off for faster doing?

    I think the approach "Update table set guid = guid" will work, but I don't think it's nice...

    I'm curious about your answers.

  • I'm sure the trigger doesn't do magic inside its code. You could perform the same operations getting rid of the INSERTED/DELETED logical tables.

    Updating the whole table with guid = guid will only waste IO.

    -- Gianluca Sartori

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

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