auto_increment field auto filled

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • millisami
    New Member
    • Nov 2006
    • 1

    auto_increment field auto filled

    I have a table with a primary varchar key and some others columns.
    I want to add a new column at the begining of the table which is Numeric auto_increment. When I add this new column via phpMyAdmin, the column is added with all the values set to 0.
    But what I want is that the values of this newly added column to be like 1,2,3,4,....... ..,nth no of rows in the table.
    How can I do it?
    Any help is appreciated.
    Thanks.
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    I have the strong suspicion that your column is not an indexed column. And AUTO_INCREMENT columns must be indexed.

    Ronald :cool:

    Comment

    • roshancaptain1
      New Member
      • Oct 2006
      • 14

      #3
      auto increment can be done using this code

      create table table_name
      (
      col_name datatype(should be int) identity(1,1),
      col_name ............... ............... ....


      )


      this is for auto incrementing

      Comment

      Working...