• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

converting autonum from Ms Access

hi all,
i m doing database migration from Ms Access to SQL Server 2000.but there is a field of a table in Ms Access that i use autonum. when i do import data in SQL Server that field become int in SQL Server.

now i want to change to some sort of autonum in sql server but i couldn't find it. wat else data type i can use to hav auto increment feature?is it available in sql server?

daniel
0
daniellyh
Asked:
daniellyh
  • 2
1 Solution
 
robertjbarkerCommented:
You would use identity(n,1) on the column that was autonum.
0
 
robertjbarkerCommented:
When you define the SQL Server target table the column corresponding to the autonum column would be defined using identity:

create table a (ii int identity(1,1))

When you are transferring the data from access to SQL Server you need to use:

SET IDENTITY_INSERT a ON

If you are using DTS in Enterprise Manager, there is a checkbox corresponding to this SET statement.
0
 
daniellyhAuthor Commented:
hi robertjbarker,
thx for prompt reply n accurate ans.

daniel
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now