Kjell Lannoo

Kjell Lannoo

  • NA
  • 6
  • 705

Trigger on insert

May 30 2020 1:46 PM
I'm trying to write a trigger that when a car gets added to my column (autonr) it should automaticly update the risk with a +1 in my (Risico) column.
 
This is how the database is made up.
dbo.autos
   auto nr (PK, int, not null)
   typenaam (char(50),null)
   bouwjaar (int,null)
   waarde (int,null)
   passagiers (int,null)
   lidnr (FK, int, null)
   Risico (smallint, null)
dbo.deelenemers
    auto nr (PK,FK, int, not null)
   evenementnr (PK,Fk,int not null) 
 
Anyone who could assist me with this? I'm a newbie and not yet verry experienced with Microsoft SQL server Management studio. 

Answers (3)