SQL Server Performance

Auto increment

Discussion in 'Getting Started' started by Jonathan Trahair, Feb 13, 2008.

  1. Jonathan Trahair New Member

    SQL Server Express 2005 won't accept: CREATE TABLE Customers(RecNo INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (RecNo)). If I remove AUTO_INCREMENT then it works fine, but won't auto increment the record number RecNo. What term should I use? Thanks in advance.
  2. Adriaan New Member

    In T-SQL it's called IDENTITY - check Books Online for correct usage.
  3. satya Moderator

  4. FrankKalis Moderator

    You would also want to give an explicit name to your Primary Key constraint and not rely on the system generated one. [:)]
  5. Adriaan New Member

    If he was coming from Access, he would have called it AutoNumber.[;)]
  6. Jonathan Trahair New Member

    My background in databases is Access - and also MySQL - and now SQL Express, and that's why I am confused! Auto increment is now sorted, thanks to all.

Share This Page