insert into problem

  • Hello

    I´ve a table

    TURNO (numetic)

    DATE (date)

    b1comp (numetic)

    b2com (numetic)

    ....

    i´ve this query to insert values into this table, my only problem is to figure a way to always on the last insert row incremment the turno number ( like turno=turno+1)

    every row on the table should have a unique TURNO number

    123,124,125,(...)

    please help

  • Did you consider using the IDENTITY(1,1) option for the column?

    (please note that there might be gaps due to invalid inserts or deleted rows).

    If you need to have the values in sequence, search this site for "sequence table" or post back with a few more details.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • tks a lot!

    just see how to do it

    ...always learning!

  • Please don't double post. This is essentially the same question I answered here.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

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

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