SO I'm new to SQL server from SQLite and I am used to using the New|Old keywords. I have seen that some people use the inserted
value refer to a newly created row, but this would only apply on an insert and not an update. Howe can I get something like the New
I use in this query?
create trigger ports_country_id_in_check
on [SISTEMA].Puerto
after insert, update
AS
BEGIN
update [SISTEMA].Puerto
set country_id = (select secuencia from [SISTEMA].Pais where codigo = New.pais_asociado)
where [SISTEMA].Puerto.secuencia = New.secuencia
end