IF OBJECT_ID('TABELA DATA NOTA', 'U') IS NOT NULL DROP TABLE [TABELA DATA NOTA];
CREATE TABLE [TABELA DATA NOTA] ([NUMERO1] INT, [DATA] DATE);
DECLARE @DATAINICIAL DATE;
DECLARE @DATAFINAL DATE;
DECLARE @NUMNOTAS INT;
SET @NUMNOTAS = 0;
SET @DATAINICIAL = '20170101';
SET @DATAFINAL = '20170110';
WHILE @DATAINICIAL <= @DATAFINAL
BEGIN
SELECT @NUMNOTAS = COUNT(*)
FROM [NOTAS FISCAIS]
WHERE DATA = @DATAINICIAL;
PRINT CONVERT(VARCHAR(10), @DATAINICIAL) + ' --> ' + CONVERT(VARCHAR(10), @NUMNOTAS);
INSERT INTO [TABELA DATA NOTA] ([NUMERO1], [DATA])
VALUES(@NUMNOTAS, @DATAINICIAL);
SET @DATAINICIAL = DATEADD(DAY, 1, @DATAINICIAL);
END;
Seria isso ?