2
When I run the following Procedure, Sqlserver gives the error:
Must declare the scalar variable error "@VDIAPARALYZED".
Procedure:
BEGIN
SELECT @VDIAPARALISADO = COUNT(F.DATA)
FROM ED_FERIADO F
WHERE F.EDEMPRESA_ID = @PEDEMPRESA_ID
AND F.GMUNICIPIO_ID = @PGMUNICIPIO_ID
AND F.SECRETARIA_ID = @PSECRETARIA_ID
AND F.ANO = @PANO
AND F.TIPO IN ('6')
AND F.DATA BETWEEN @DT_INICIO
AND @DT_FIM
AND F.DATA NOT IN (
SELECT C.DATA
FROM ED_CALENDAR C
WHERE F.EDEMPRESA_ID = @PEDEMPRESA_ID
AND F.GMUNICIPIO_ID = @PGMUNICIPIO_ID
AND F.SECRETARIA_ID = @PSECRETARIA_ID
AND F.ANO = @PANO
AND F.DATA BETWEEN @DT_INICIO
AND @DT_FIM
AND C.TIPO_CALEN = @VTIPO_CALENDARIO
)
END
I do not think it should be closed, it is not a typo, but rather a lack of variable declaration, it can happen to other people.
– Jorge B.