0
I’m creating a Rigger to create a copy of the changed data in the table. But it presents an error.
USE [BANCO1]
GO
/****** Object: Trigger [dbo].[BANCO1] Script Date: 08/07/2015 14:13:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[BANCO1]
ON [dbo].[TABLE1]
AFTER UPDATE
AS
BEGIN
DECLARE
@NOSSONRO VARCHAR(15)
SELECT @NOSSONRO = E1_NUMBCO FROM UPDATED
SET NOCOUNT ON;
UPDATE TABLE1 SET E1_NOSNRO = @NOSSONRO WHERE E1_NOSNRO='' AND E1_NUMBCO=@NOSSONRO
END
Caution when creating trigger procedures in SQL Server: Pitfalls in Trigger programming -> https://portosql.wordpress.com/2018/08/18/armadilhas-na-programacao-de-trigger/
– José Diz