• Domingo 5 de Mayo de 2024, 15:48

Autor Tema:  Xq No Funcionan Las Sumas En Los Triggers? En Sql  (Leído 1538 veces)

maikmr

  • Miembro MUY activo
  • ***
  • Mensajes: 112
    • Ver Perfil
Xq No Funcionan Las Sumas En Los Triggers? En Sql
« en: Jueves 26 de Enero de 2006, 01:42 »
0
Código: Text
  1.  
  2. CREATE TRIGGER sumar
  3. on historial_laboral
  4. for update        
  5. as
  6. Declare @Id_historyLab    int
  7. Declare @monto              float
  8. Declare @neto                 float
  9.  
  10. set @Id_historyLab=(select max(Id_historyLab) from historial_laboral)
  11. set @monto = (select salario_neto from historial_laboral where Id_historyLab = @Id_historyLab)
  12.  
  13. update historial_laboral
  14. set salario_neto= (@monto+1000.0)
  15. where Id_historyLab = @Id_historyLab
  16.  
  17.  

Intente hacer una suma en un trigger pero no funciono, esta donde yo se deberian funcionar pues yo eh visto que si se pueden hacer operaciones aristmeticas en las bases de Datos.
gracias.