auto numbering..

  • Hi frens,

    Can anyone help me to find the solution to have auto-incremented column with least complexity in myTable. New record inserted is to have unique ID in column MyCol datatype bigint. Using trigger, or computed column, or whatever...

    I know you guys can effortlessly solve this problem.

    Thanks in advance,

    Chhana

  •  CREATE TABLE myTable

            (

            myCol BIGINT IDENTITY(1,1),

            Col1....

            .... other column data

            ....

            )

    --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)

  • thanks. even a simple query can help a blind man. ASCII stupid question, getting useful ANSI. It works perfectly.

    Thanks

    chhana

  • You bet, Chhana.  Simple is good.  Thank you for the feed back.

    --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)

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

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