Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
How to create a column with auto increment in sql server
2402 Views
Introduction 
Identity used to generate number automatically in sql server.In the following example s_no generated automatically,when you are inserting the values in other columns.The value start from 1 and increment value also 1 so it ll be like 1,2,3.....
Syntax 
IDENTITY( seed, increment)
Example
	create table Customer(
	s_no int IDENTITY(1,1) primary key,
	First_name varchar(20),
	Last_name varchar(20),
	Address varchar(20))
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details