how to insert identity to an column in a table

Posted by Parthibansk under Sql Server on 12/20/2012 | Points: 10 | Views : 766 | Status : [Member] | Replies : 5
i have table prices..

COLUMNS

ID NAME PRICE QUANTITY.. I NEED TO ADD IDENTITY VALUE TO ID COLUMN.. I TRIED TO MODIFY IN DESIGN MODE IT GIVES DENIED PERMISSION ERROR..

HOW TO QUERY TO ADD IDENTITY TO ID COLUMN STARTING FROM 1640.. WITHOUT DROPING TABLE...




Responses

Posted by: Pavanandey on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
Alter Table Names
Add Id_new Int Identity(1, 1)



Thanks
Pavan Kumar
Mark Answer if this fits the need

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
mark answer if this helps you

Thanks
Pavan Kumar
Mark Answer if this fits the need

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
Alter Table Names
Add Id_new Int Identity(1, 1)



Thanks
Pavan Kumar
Mark Answer if this fits the need

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sandeepmhatre on: 12/21/2012 [Member] Starter | Points: 25

Up
0
Down
http://sandeepmhatre.blogspot.com/2012/12/reset-identity-in-sql-server.html

Sandeep M,
Software Developer
Follow me on :
http://sandeepmhatre.blogspot.in

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shanky11 on: 12/22/2012 [Member] Starter | Points: 25

Up
0
Down
alter table table_name
ALTER COLUMN YourColumnName int identity

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response