Solved

How to create table with auto increament field

Posted on 2000-03-27
4
242 Views
Last Modified: 2012-08-13
How to create table with auto increament field like in MS-Acccess

  Dewi
0
Comment
Question by:Dewi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
crsankar earned 50 total points
ID: 2660293
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2660316
What type of database is it? Is it an MS-Access database or another one?

Some databases do not support auto-increment fields.
0
 
LVL 6

Expert Comment

by:crsankar
ID: 2662710
Since it is posted in the sql-server section I am assuming that you are talking about a sql server database.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2663122
<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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question