Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have table in my database with primary key allow null 'NO', default value set to '((0))' and identity specification to 'No'.

I need primary key to auto increment. so blank out default value and set identity specification to 'Yes'.

but i need sql query for that which can auto increment my primary column and remove default value.

Thanks,
KK
Posted
Comments
Maciej Los 13-Sep-13 2:22am    
Waht have you done till now?

1 solution

Hi,

I found partially solution. i can reset the default value by below query.

ALTER TABLE tblname DROP CONSTRAINT constraint.

but what will be the script to auto increment my existing primary key?

thanks,
kk
 
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