Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    24

    Unanswered: How do I add counter (auto-increment)

    For example a customer makes a reservation we add to his or her counter, this would be determined by adding a row in the appointment table with that customer details.

    ID Field .... Auto increment Field
    1000 ........... 1
    1000 ........... 2
    1100 ........... 1
    1100 ........... 2
    1100 ........... 3

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    look in da manual for IDENTITY property

    note that it will not reset for each ID field like it does in MySQL

    if you want an incrementing number per ID, you have to code this yourself in SQL Server
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •