UPDATE()

24/11/2005 - 22:08 por Alexc - Perú | Informe spam
Hola amigos, recuurro a ustedes para que me expliquen que es lo hace :
IF UPDATE(nota) or UPDATE(nota2)

en el siguiente código:
de antemano gracias

CREATE TRIGGER [auditoria] ON [ot]
FOR UPDATE
AS

IF UPDATE(nota) or UPDATE(nota2)

INSERT INTO ot_audi( tipo_operacion,custom,fecha_alumno,codigo,nota)
SELECT 1,ot.t_custom,ot.t_date,ot.t_codigo,ot.nota
FROM ot
INNER JOIN inserted
ON ot.t_custom = inserted. t_custom and ot.t_date = inserted.
t_date and ot.nota = inserted. nota
WHERE ot.Terminado=1

Preguntas similare

Leer las respuestas

#1 Gustavo Larriera [MVP]
24/11/2005 - 22:18 | Informe spam
Sirve para detectar si un valor ha cambiado en una cierta columna. Considera
también el uso de la función COLUMNS_UPDATED() .

Gustavo Larriera
Uruguay LatAm
Blog: http://sqljunkies.com/weblog/gux/
MVP profile: http://aspnet2.com/mvp.ashx?GustavoLarriera
Este mensaje se proporciona "COMO ESTA" sin garantias y no otorga ningun
derecho / This posting is provided "AS IS" with no warranties, and confers
no rights.
"Alexc - Perú" wrote in message
news:
Hola amigos, recuurro a ustedes para que me expliquen que es lo hace :
IF UPDATE(nota) or UPDATE(nota2)

en el siguiente código:
de antemano gracias

CREATE TRIGGER [auditoria] ON [ot]
FOR UPDATE
AS

IF UPDATE(nota) or UPDATE(nota2)

INSERT INTO ot_audi( tipo_operacion,custom,fecha_alumno,codigo,nota)
SELECT 1,ot.t_custom,ot.t_date,ot.t_codigo,ot.nota
FROM ot
INNER JOIN inserted
ON ot.t_custom = inserted. t_custom and ot.t_date = inserted.
t_date and ot.nota = inserted. nota
WHERE ot.Terminado=1


Respuesta Responder a este mensaje
#2 Alexc - Perú
24/11/2005 - 22:23 | Informe spam
Ok, gracias.

"Gustavo Larriera [MVP]" escribió en el mensaje
news:%
Sirve para detectar si un valor ha cambiado en una cierta columna.


Considera
también el uso de la función COLUMNS_UPDATED() .

Gustavo Larriera
Uruguay LatAm
Blog: http://sqljunkies.com/weblog/gux/
MVP profile: http://aspnet2.com/mvp.ashx?GustavoLarriera
Este mensaje se proporciona "COMO ESTA" sin garantias y no otorga ningun
derecho / This posting is provided "AS IS" with no warranties, and confers
no rights.
"Alexc - Perú" wrote in message
news:
> Hola amigos, recuurro a ustedes para que me expliquen que es lo hace :
> IF UPDATE(nota) or UPDATE(nota2)
>
> en el siguiente código:
> de antemano gracias
>
> CREATE TRIGGER [auditoria] ON [ot]
> FOR UPDATE
> AS
>
> IF UPDATE(nota) or UPDATE(nota2)
>
> INSERT INTO ot_audi( tipo_operacion,custom,fecha_alumno,codigo,nota)
> SELECT 1,ot.t_custom,ot.t_date,ot.t_codigo,ot.nota
> FROM ot
> INNER JOIN inserted
> ON ot.t_custom = inserted. t_custom and ot.t_date = inserted.
> t_date and ot.nota = inserted. nota
> WHERE ot.Terminado=1
>
>


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida