DECLARE @LIMITECREDITO FLOAT
DECLARE @LIMITECREDITOACUM FLOAT
DECLARE CURSOR1 CURSOR FOR SELECT [LIMITE DE CREDITO]
FROM [TABELA DE CLIENTES]
SET @LIMITECREDITOACUM = 0
OPEN CURSOR1
FETCH NEXT FROM CURSOR1 INTO @LIMITECREDITO
WHILE @@FETCH_STATUS = 0
BEGIN
SET @LIMITECREDITOACUM = @LIMITECREDITOACUM +
@LIMITECREDITO
FETCH NEXT FROM CURSOR1 INTO @LIMITECREDITO
END
CLOSE CURSOR1
DEALLOCATE CURSOR1
PRINT @LIMITECREDITOACUM
Fiquei com duvida o porque o @LIMITECREDITOACUM recebe 0