Skip to the content.

Variables must be declared before being used; you probably moved some code around…

Bad:

select @i;
declare @i int = 42;

Good:

declare @i int = 42;
select @i;