• I agree with everyone about using SQL to do formatting, but this will work

    DROP TABLE #Doit

    CREATE TABLE #Doit

    (a INT IDENTITY,z INT)

    go

    INSERT INTO #Doit(z)

    VALUES(NULL)

    GO 50

    SELECT '------------------

    ',a,'

    -----------------'

    FROM #Doit