Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 30-03-2004
Avatar de guillotmarc
guillotmarc guillotmarc is offline
Miembro
 
Registrado: may 2003
Ubicación: Huelva
Posts: 2.638
Poder: 26
guillotmarc Va por buen camino
Hola

Te has olvidado decir que Servidor SQL utilizas. Parece Transact-SQL, o sea SQL-Server ¿ correcto ?.

En ese caso puedes utilizar la cláusula IF UPDATE(Campo)

Ejplo.

Código:
CREATE TRIGGER Actualiza_Estado_Cmpnas ON CMPNAS FOR UPDATE AS
declare @CDGOCMPNATEMP integer, @ACTIVOTEMP integer
begin 
  IF UPDATE(Activo) 
  BEGIN
    SELECT @CDGOCMPNATEMP = CDGO, @ACTIVOTEMP = ACTIVA FROM INSERTED
    UPDATE CMPNASLIN SET ACTIVO = @ACTIVOTEMP WHERE CDGOCMPNA = @CDGOCMPNATEMP
    UPDATE CMPNASLINSUP SET ACTIVO = @ACTIVOTEMP WHERE CDGOCMPNA = @CDGOCMPNATEMP	
    UPDATE FCTRASCAB SET ACTIVA = @ACTIVOTEMP WHERE CDGOCMPNA = @CDGOCMPNATEMP
  end
end
Saludos.
__________________
Marc Guillot (Hi ha 10 tipus de persones, els que saben binari i els que no).
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 17:20:38.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi