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
Solved

How to create table with auto increament field

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

  Dewi
0
Comment
Question by:Dewi
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

860 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