help me to select ROW_NUMBER in sql server 2000

  • help me to select ROW_NUMBER in sql server 2000

  • there is no row_number () in sql 2000.

    "Keep Trying"

  • Miss Qureshi (10/15/2008)


    help me to select ROW_NUMBER in sql server 2000

    Why do you want to have row_number?

    Do you want to simply generate serial no for the recordset?

    If so, do this numbering in the front end application if you use


    Madhivanan

    Failing to plan is Planning to fail

  • Hello,

    Another way to have a row number is to use the alter table command and add a rowId int identity field to the table ( unless it already has an identity field ).

    When you add the rowId column, it will create the column and populate it with a row number.

    like :

    alter table yourTableName

    add rowId int identity

    Regards,

    Terry

  • I disagree with the idea of NOT using an IDENTITY for such a purpose if it's on a Temp Table.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • i usually just place what is needed into a temp table as below:

    select

    RowNumber = identity(int,1,1)

    ,Column_1

    ,Column_2

    into #im_temp0

    from <tableName>

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

Viewing 8 posts - 1 through 7 (of 7 total)

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