Just make sure you really need a LOOP.
SQL Server is optimized for datasets, not for loops.
Maybe if you post what is your problem, we could figure out a non-loop decision.
Of course this is depending of your needs (sometimes LOOPs are mandatory ))))
Actually I've been working on a way to do it without a loop that seems to be coming together quite well. Use and update for is greater then period plus a second update for a different field for with is greater then or equal.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.