Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Can i create a table with a field auto increment?
Posted

Yes!
Make it an Identity column[^] with a defined increment step.
 
Share this answer
 
Comments
call to .net 13-Sep-10 6:43am    
thanks sandeep
Sandeep Mewara 13-Sep-10 6:50am    
Good to know it helped. :)
You have to use Identity propertes for the column
Make Identity : Yes
Identity Seed - From which valule will ne start
Identity Increment - Incremented by value
 
Share this answer
 
u can create table like
SQL
create table a
(id int identity(1,1))
 
Share this answer
 
hey this is the example:-


create table employee
( id int identity(100,1),
name varchar(100))


here identity start from 100 and increment by 1 automatically with each entry...........
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900