Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/07/2011, 12:59
serge_1943
 
Fecha de Ingreso: julio-2011
Mensajes: 2
Antigüedad: 12 años, 9 meses
Puntos: 0
Respuesta: Expresion Case

MITABLA GENTE

create table gente(
id int identity primary key,
p1 bit,
p2 bit,
p3 bit,
p4 bit
)
MI TABLA OBSERVACIONES

create table Observaciones(
ID int identity primary key,
IDAlumnos int,
observacion nvarchar (200)
)

LO QUE DESEO HACER ES QUE AL INGRESAR DATOS EN LA TABLA GENTE POR CADA CAMPO INSERTE UN COMENTARIO AUTOMÁTICAMENTE EN LA TABLA OBSERVACIONES
EJEMPLO :
update gente set p1=1,p2=1,p3=0,p4=0 where id = 1
si el dato insertado es "0" en el caso de p3 el comentario deberia ser "sin certificado", en p4 "sin DNI" ;en caso de que sea "1" no hay comentario.

Y en la tabla observaciones en el campo observacion deberia insertarse automaticamente "sin certificado;sin DNI"