Sunday 20 October 2013

sql server 2005/2008 | primary key | Identity key | Auto increment

how to set identity by query in table .
while creating by query in sql server 2008-2005 if you want to add
primary key with identity then you need to add primary key with identity at same time.
or if  you have already added then alter that  column but need to take care of  it.
here i have shown how to add identity with primary key in sql server 2005 and sql server 2008.
db name is stud
and table name is student.

user stud
create table student
(
id int NOT NULL primary key identity ,
roll int not null,
name varchar(30) not null

)
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: