Solved

How to create table with auto increament field

Posted on 2000-03-27
4
209 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

861 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now