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
- What’s New in Silverlight 5?
- Converting Colors to Gray Shades
- Merge your assemblies using ILMerge
- Windows Vista File and Registry Virtualization
- Working with SQL Server BLOB Data in .NET