Came across this code today. Sticking it in my personal 'Wat?' file (https://www.destroyallsoftware.com/talks/wat/)
Lump this in with the "hey, did you know you can DECLARE and set to a value without being inside a SP"?
This code works on 2008 and higher.
DECLARE @i INT = 1
WHILE @i < 5
BEGIN
DECLARE @a INT = 4
PRINT @i
SET @i = @i+1
END
Tuesday, September 4, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment