Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
tag do sgbd
Link
José Dız
  • 7mil
  • 2
  • 18
  • 30
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
adicionou 70 caracteres ao conteúdo
Fonte Link
Franchesco
  • 5,3mil
  • 3
  • 28
  • 48

Boa tarde pessoal,

Estou criando um trigger para criar uma copiacópia dos dados alterados na tabela. poremPorém apresenta um erro.

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;

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

END

Boa tarde pessoal,

Estou criando um trigger para criar uma copia dos dados alterados na tabela. porem apresenta um erro.

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

Estou criando um trigger para criar uma cópia dos dados alterados na tabela. Porém apresenta um erro.

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
Fonte Link

Criação de Trigger Sql Server

Boa tarde pessoal,

Estou criando um trigger para criar uma copia dos dados alterados na tabela. porem apresenta um erro.

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