Unfortunately you canâ€™t convert your normal Numeric column to a AutoNumber column if there’s data existing in the table even if the numbers follow a series and are ordered properly.
However, you can do a little trick. Just follow these steps:
- Create a new table with an AutoNumber column.
- Copy all columns except that Number column from the original table to the new table.
- Copy all data of all columns except that Number column from the original table to the new table.
- Delete the original table.
- Name the new table with the same name as the original table deleted.
- Congratulations! You have finished. :)
More advanced solution? Check it out here.
- Retrieving Motherboard Serial Number using WMI
- Enumerating SQL Server Instances
- Programmatically Enumerating, Attaching, and Detaching SQL Server Databases
- Hacker Develops Tool to Hide Malware in .NET
- Why you receive a System.Security.SecurityException exception!
- BeginPaint/EndPaint or GetDC/ReleaseDC?
- Marshaling with C# Pocket Reference
- Converting between color decimal and hexadecimal representation