auto number generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajeshncc
    New Member
    • Oct 2007
    • 1

    auto number generation

    i have created table in sqlserver and i connected to my front end vb.net
    its working properly. i have one primary key field that should increment automatically how i can i do that
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    You can declare the Column in SQL Server, as Auto Increment column :
    Go to the Table Design and select the Column, Down at the column properties box change :

    Identity = yes
    Identity seed =Number you want to start with
    Identity increment = how much to increment each time.

    Regards
    Veena

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      else you can als select the max value of the primary key field +1 as the new value for the field.

      Comment

      Working...