Microsoft sql server 2005 autonumber


















Our community of experts have been thoroughly vetted for their expertise and industry experience. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

All rights reserved. Covered by US Patent. Come for the solution, stay for everything else. Welcome to our community! Microsoft Access has a data field type [Auto Number] which I often use as a primary key field.

This shouldn't be a performance problem as the table won't get much larger than records. While ordering by date or even the orderID column will give you the same results, the whole sequence numbering system will fall apart when somebody decides to delete an order I think he's doing the right thing by giving the client what they asked for. Add a comment. Active Oldest Votes. Again, if I'm incorrect on this, please let me know.

Preferably with a URL. ScottS ScottS 8, 3 3 gold badges 27 27 silver badges 48 48 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. On the column properties box, set Identity Specification as "Yes" and keep the Identity Increment and Identity Seed values as default ones.

This generate an "auto-number" based on a start value and an increasing value. HTH; Jens Suessmeyer. Sign in. United States English. Ask a question. Quick access. User posted Why should you care what the next number will be? Friday, June 15, PM. User posted Hi dbland, Actually I have to save two records in two different tables and after one records save I have to take fetch the identity of that record and set that identity aas the fireign key for the second records but as both the records we are entering are in the same transaction i.

Saturday, June 16, AM. User posted i think if you are still going to implement this then use max in the query to retrive the highest figure in the column. Saturday, June 16, PM. User posted Thanks, Girish, for that clarification. Here's an example declare LastId int begin tran insert



0コメント

  • 1000 / 1000