Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

How to create table with auto increament field

How to create table with auto increament field like in MS-Acccess

  Dewi
0
Dewi
Asked:
Dewi
  • 2
  • 2
1 Solution
 
crsankarCommented:
create table abc
(col1 numeric identity(1,1))

Note that when you use identity the column should not allow decimal values

idenity(seed,increment)

where seed is the starting value
increment is how much to increment by each time
0
 
caraf_gCommented:
What type of database is it? Is it an MS-Access database or another one?

Some databases do not support auto-increment fields.
0
 
crsankarCommented:
Since it is posted in the sql-server section I am assuming that you are talking about a sql server database.
0
 
caraf_gCommented:
<doh>
Sorry, I came into this question after a redirection from elsewhere. I wasn't aware it was in the SQL server area....
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now