Share via

Trigger on recursive update

Massimo Valtolina 20 Reputation points
Sep 18, 2023, 1:24 PM

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.
14,256 questions
{count} votes

Accepted answer
  1. Olaf Helper 45,391 Reputation points
    Sep 28, 2023, 11:02 AM

    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
    Sep 28, 2023, 10:40 AM

    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.