• --Here's a set based solution.

    Declare @n Table (i integer Not Null, Primary Key(i))

    Insert @n

    Select 0 as i Union All

    Select 1 Union All

    Select 2 Union All

    Select 3 Union All

    Select 4 Union All

    Select 5 Union All

    Select 6 Union All

    Select 7 Union All

    Select 8 Union All

    Select 9

    Select

     x,

     Case When x % 3 = 0 Then 'Bizz' Else '' End + Case When x % 5 = 0 Then 'Buzz'  Else '' End as tag

    From

     (Select

      tens.i * 10 + units.i + 1 as x

     From

      @n units

     Cross Join

      @n tens

    &nbsp as A

    Order By

     x