SHARE
TWEET

Caducar Manual Asientos

lesther312 Mar 15th, 2017 (edited) 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. declare @Asiento varchar(100) = '197-137-cr03'
  2.  
  3. declare @asientoId int,
  4.         @minutaId int,
  5.         @usuarioAsignadoId int = 327
  6.  
  7. select
  8.     @asientoId = id,
  9.     @minutaId = MinutaId
  10. from Asiento
  11. where
  12.     Asiento = @Asiento
  13.  
  14. insert into Bitacora
  15. (MinutaId,EstatusId,EstatusSecundarioId,UsuarioAsignadoId,AsientoId,Creado,CreadoPor)
  16. values
  17. (@minutaId,5,5,@usuarioAsignadoId,@asientoId,getdate(),-5515)
  18.  
  19. declare @ultimaBitacoraId int = Scope_Identity()
  20.  
  21. update Asiento set UltimaBitacoraId = @ultimaBitacoraId where id = @asientoId
  22.  
  23. select * from Bitacora where MinutaId = @minutaId order by id
  24. select * from Asiento where id = @asientoId
RAW Paste Data
Top