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
- Windows 7 .NET Interop Sample Libraries
- Consuming URL Shortening Services – bit.ly
- Intellisense for Google Maps API in Visual Studio
- Marshaling with C# – Chapter 3: Marshaling Compound Types
- Programmatically Swapping Mouse Buttons