Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. autoNumber and Max+1 which is Best

autoNumber and Max+1 which is Best

Scheduled Pinned Locked Moved Database
architecturequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TariqMahmood
    wrote on last edited by
    #1

    Autonumber and Max+1 which is Best for long term What are their advantages and disadvantages please answer these question with solid reason Tariq Mahmood Software Engineer

    J D 2 Replies Last reply
    0
    • T TariqMahmood

      Autonumber and Max+1 which is Best for long term What are their advantages and disadvantages please answer these question with solid reason Tariq Mahmood Software Engineer

      J Offline
      J Offline
      Just Greeky Creek
      wrote on last edited by
      #2

      if u need sequential ID serie , MAX+1 is the best. Because sometimes in rollbacked transactions, AutoNumber is generated but it is not used and ,in a new record, u may see number series like 1,2,3,4,6,7,8 (that means in 5th saving,something went wrong, and data wasnt saved to database but autonumber generated) if u doesnt need sequential ID serie , AutoNumber is best. Because when u insert a new row to database,First u have to read Max number, then increase that number after checking that value is null either not.Sometimes to control this value is painful

      1 Reply Last reply
      0
      • T TariqMahmood

        Autonumber and Max+1 which is Best for long term What are their advantages and disadvantages please answer these question with solid reason Tariq Mahmood Software Engineer

        D Offline
        D Offline
        David Salter
        wrote on last edited by
        #3

        If you're ever going to have more than one user acces your database, then you have to use AutoNumber. Max+1 could potentially give problems if two people (or processes) inserted into the datbase at the same time.


        Database FAQ

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups