EXEC lives in its own scope, so no, it is not defined.
You might try something like:
declare fiscalYear int
N'SELECT fiscalYear = max(FiscalYear) from DateTable',
N'fiscalYear INT output',
And you might also read about the pitfalls of the approach you're taking:
"David" <xx.com> wrote in message