I hope someone can help me. This is my first post ever, so I hope I explained it well.

I am using Microsoft SQL Management Studio.

I am trying to make a trigger that is not letting anyone change the personal number of a person if that person didn't return a computer in a database that I made.

So I am making a trigger for table Person where I have ID\_Person primary key, Name, Surname and a Personal\_numb.
Also, I made a table called Renting where I have columns: ID\_Renting primary key, ID\_Person foreign key, ID\_Computer foreign key and Date\_Rented and Date\_Returned columns..
Here is how my code look a like:

```
create trigger NO
On Person
after update
as
 begin
 if update(Personal_numb)

 (select ID_Person from Renting
 where Renting.Date_Returned is null)
 begin
 Raiserror('Person needs to return the computer before you try to change their personal number!', 16,1)
 end
 end

```

However, I know that I am missing something between if update(Personal\_numb) and select but what is it?