• use a bit variable for your break-condition and add it to your while:

    @do_break = 0

    while @counter < @upper_limit and @do_break = 0 begin

    ...

    if [your_condition]

    @do_break = 1

    ...

    end

    best regards,

    chris.