Q:

Ttrigger after insert

I'm trying to write trigger which enters a value (+1) into another column.
If I add a new car into the dbo.deelnemers/autonr my dbo.auto's/risico column should be added with the value +1
create trigger trRisicos
on deelnemers
after insert
as
begin
    set nocount on;

    declare u/autonr int

    select u/autonr = inserted.autonr
    from inserted

    insert into autos
    values (@autonr, 1)
end

This is the code I have so far.
dbo.deelnemers/autonr (PK, FK, INT, NOT NULL)
dbo.deelnemers/evenementnr (PK, FK, INT, NOT NULL)

dbo.autos/autonr (PK, INT, NOT NULL)
dbo.autos/typenaam (CHAR(50), NULL)
dbo.autos/bouwjaar (INT, NULL)    
dbo.autos/waarde (INT, NULL)
dbo.autos/passagiers (INT, NULL)
dbo.autos/lidnr (FK, INT, NULL)
dbo.autos/Risico (SMALLINT, NULL)

A:

Try this:

create trigger trRisicos
on deelnemers
after insert
as
begin
    set nocount on;

    INSERT INTO autos (autonr, risico)
    SELECT autonr, 1
    FROM INSERTED;
end

