Creating a sequence

Discussion in 'Databases' started by kiran, Sep 21, 2010.

  1. Hi All...

    In my table there is no primary key. So, I want to insert a column as Sequence number which will be a primary key...

    I am thinking to do it by using SEQUENCE command.
    But it is getting error...

    Can you help me...
     
  2. Ray

    Ray

    My understanding is that you want to setup a Primary key column and you want it to auto populate. Why not use the auto_increment command?

    PK_ID int Not Null Auto_increment
     
  3. Use this instead

    PK_ID int Not Null Identity (1,1)
     
  4. Ray

    Ray

    I believe if you do not specify it, the default is (1,1).
     

Share This Page