Home Forums SQL Server 2005 T-SQL (SS2K5) Create #Temp Table using While Loop Instead of Cursor RE: Create #Temp Table using While Loop Instead of Cursor

  • kscott-851323 (8/12/2010)


    I want to create a temporary table using a While Loop instead of a Cursor.

    Why? If you're trying to remove the cursor, a while loop is no better. Just another form of row-by-row processing.

    Is the end goal to use a cursor/loop, or is the end goal to populate a table?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass