I have the trigger below:
CREATE TRIGGER AtualizaDataAlteracaoSegmentos
ON dbo.Segmentos
AFTER INSERT,UPDATE
AS
BEGIN
Begin tran
update Segmentos
set DataAlteracao = GETDATE()
where Id = (select ID from inserted);
Commit;
END;
Is there any way I can update this field without activating the trigger again?
In Oracle I know I could do in BEFORE and instead of giving the update in this way assign the value of NEW.dataChange however in SQL Server I do not know how to proceed.