Skip to content

Instantly share code, notes, and snippets.

@yhau1989
Created March 21, 2019 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yhau1989/a44993e1520aa09ff7617ba75f1ace09 to your computer and use it in GitHub Desktop.
Save yhau1989/a44993e1520aa09ff7617ba75f1ace09 to your computer and use it in GitHub Desktop.
declare @cod as INT
DECLARE @grupoArticulo AS NVARCHAR(MAX)
DECLARE @totalPack AS INT
DECLARE @SumUnidadesPak INT
DECLARE @SumtotalUnidades INT
declare CURSORITO cursor FOR (select id_orden_pedido_detalle,GRUPO_ARTICULO, totalPack FROM #temp_table_name)
open CURSORITO
fetch next from CURSORITO into @cod, @grupoArticulo, @totalPack
while @@fetch_status = 0
begin
fetch next from CURSORITO
into @cod, @grupoArticulo, @totalPack
END
close CURSORITO
deallocate CURSORITO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment