Trigger on recursive update

Massimo Valtolina 20 Reputation points
2023-09-18T13:24:57.5666667+00:00

Hello

I created a trigger that only works if I update only one record at a time. If I perform a multiple update, only the first record updates me. Any ideas?

Thanks in advance

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,784 questions
{count} votes

Accepted answer
  1. Olaf Helper 44,501 Reputation points
    2023-09-28T11:02:49.59+00:00

    I created a trigger that only works if I update only one record at a time.

    Then your trigger code is wrong.

    You have to use the virtual table "inserted" and "deleted", which contains all 1-n effected records, see

    Use the inserted and deleted tables

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Massimo Valtolina 20 Reputation points
    2023-09-28T10:40:42.7566667+00:00

    I didn't have the chance to try, I changed my strategy

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.