ADDING A ROW NUMBER IN A QUERY

  • In SQL 2005 there's a new function ROW_NUMBER() is there something equivalent in SQL 2000?

    Thanks

    Chris

  • No. You would have to roll it your self using temporary objects...

  • Christopher Joel Diaz (10/1/2007)


    In SQL 2005 there's a new function ROW_NUMBER() is there something equivalent in SQL 2000?

    Thanks

    Chris

    You could use a temporary table with identity:

    SELECT IDENTITY( INT, 1,1 ) row_number, *

    INTO #temptable

    FROM mytable

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Thank you very much Andras. Much appreciated.

    Chris

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply