I\'ve come across a interesting scenario (at least for me) in a stored procedure. Would like to have experts opinion and thoughts on it.
DECLARE @loopcounter
In T-SQL a WHILE..END is not individually scoped, you can for example SELECT @insidevalue after the WHILE's END.
WHILE..END
SELECT @insidevalue
WHILE
END