Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to alter normal column to idntitycolumn

Author  Topic 

boreddy
Posting Yak Master

172 Posts

Posted - 2008-05-28 : 03:16:25
Hi

I Created table like this
CREATE TABLE Table(sno int ,EName varchar(20))
I inserted three records like this
INSERT INTO hazarath VALUES (1,'ragav')
INSERT INTO hazarath VALUES (2,'ragavRavo')
INSERT INTO hazarath VALUES (3,'ramu')

Now i want to alter sno column to identity column
how can i alter to identity
pls help me


nr
SQLTeam MVY

12543 Posts

Posted - 2008-05-28 : 03:27:08
You can't.
You can drop it and add an identity though.

See
http://www.simple-talk.com/sql/t-sql-programming/identity-columns/

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2008-05-28 : 03:34:28
this link may help you

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=30549
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-28 : 03:56:37
Also this:-

http://www.mssqltips.com/tip.asp?tip=1397
Go to Top of Page
   

- Advertisement -