
02/12/2014, 09:35
|
 | Colaborador | | Fecha de Ingreso: agosto-2006 Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 18 años, 6 meses Puntos: 774 | |
Respuesta: Disparador que registre unica vez con triggers:
Código SQL:
Ver originalCREATE TRIGGER dis_registro ON empleado FOR INSERT AS BEGIN DECLARE @id INT SELECT @id=id FROM inserted IF(SELECT COUNT(*) FROM empleados WHERE id=@)=0 print 'Inserta' ELSE BEGIN print 'no inserta' ROLLBACK TRANSACTION RETURN; END END
__________________ What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me |