• As per the question, it was mentioned that "Developed and tested using SQL Server 2008 R2 SP2"; so why don`t we use the new features available from SQL Server 2008 onwards like follows:

    declare @start float = 1,

    @commonDiff float = 3,

    @counter float = 0

    print 'Begin';

    while @counter < 200

    begin

    set @counter += 1

    declare @currVal float = 0

    Setting the Variable`s values in the same declaration is more efficient, easier, faster and it looks even better.

    BTY; I tested it, got the same results.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant