Trigger after Insert?

  • Dear all, I've a table that is modified daily and has a huge amount of data, and for performance issue, I need to insert the latest daily data into a another table to perform search operations with better spped, and so, I think I need to write a trigger after insert on the first table to insert the latest rows in the other table.

    How can I do that?

  • From inside your trigger, you can access the INSERTED virtual table. This table will have the same structure as your main table and contain only the newly inserted data. You can then write an INSERT INTO statement which SELECTS columns FROM INSERTED.

    .

  • and for performance issue, I need to insert the latest daily data into a another table to perform search operations with better spped

    Have you created any indexes to improve the search?

    Any horizontal partitions?

    I feel, creating a new table is not a good idea, just for search operation. Trigger may cause performance issue.

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

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