When Upsizing an Access 2003 databse to SQL Server 2008 how can I set my autonumber fields to convert with Identity Specification set to yes and 1?
Printable View
When Upsizing an Access 2003 databse to SQL Server 2008 how can I set my autonumber fields to convert with Identity Specification set to yes and 1?
You can accomplish it in 2 ways:
1. Export data to SQL Server and then manually change the NUMBER field to include identity.
2. Create a table that already defines that field as identity, enable identity insert and do your export.
This would have to be done for around 400 tables. Manually changing the field is what drove me to post a question here. Can I do this in C# programmatically?
You can also do a straight through IMPORT into SQL Server. Select Access as your source. Then write a t-sql script to change each table to use identity. You can query sys.tables, loop through them and alter each of of them to include identity.
Serge, how would I write loop to alter each of them