D
D
dienerie2021-04-29 09:24:25
SQL Server
dienerie, 2021-04-29 09:24:25

How to update the field of the row with the desired id using a trigger in sql?

There are two tables

Table 1
Name: humans (participants)
Fields:
id
name
lastname
check_points

Table 2
Name: points_route (points marked by which a person is checked)
Fields:
humans_id
points_id

Table 3 points (points)
Fields:
id

To table 2 (points_route) we write the routes along which the person passed.
For one record id humans there can be several points (rows of records with different points) in the points_route table.

Each time you add or delete rows/rows in the points_route table, you need to set the value 0 in the humans table for the check_points field. Then, my internal system will set 1 itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2021-04-29
@tsklab

Documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question