automatic id generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sweatha
    New Member
    • Mar 2008
    • 44

    #1

    automatic id generation

    Hi

    I have the table named commission with 3 fields as id int, commission decimal(2,2), effectivedate smalldatetime. . I have to generate the id field automatically. To generate id feild automatically as 1,2,3,...., what code should I give in .net or wheather I should set any properties in sql server 2005
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    In the sql server table, you should set the Identity property on the id field to Yes.

    This is really basic MS SQL stuff. Perhaps you should find a tutorial?

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      I moved your question to MS SQL Server forum.

      -Frinny

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Start from here

        -- CK

        Comment

        Working...