Because you cant alter column whose value is filled prior.
you have options like
1) Create new table with same name and now set that column as identity
2) drop old table
But visual studio gives you abilty to do it in design time. In design just modify table structure and set identity to yes.
Internally visual management studio drop your old table and create new table with same name and structure now will copy old data to this new table.
Keep in mind you can't set Identity by altering existing column.
No comments:
Post a Comment