How do I do Identity Insert in Access

D

Dave

I have an Access table with an AutoNumber that I want to have a '0' value.

In SQL Server I can do an "Identity Insert" to override a column's Identity
(autonumber) property.

How can I do this in Access 2003.
 
G

Guest

Dave,

You cannot override the AutoNumber of Access as you describe. You also
cannot have a zero value in the auto number.
 
M

MacDermott

I beg your pardon!
I am admittedly operating in Access 2000, but I'd be mighty surprised if
this has changed.
I have a table named MyTable, with an AutoNumber field named ID.
Executing this inserts a row with a value of 0 in ID:
INSERT INTO MyTable (ID) VALUES (0)
 
A

Arvin Meyer [MVP]

MacDermott said:
I beg your pardon!
I am admittedly operating in Access 2000, but I'd be mighty surprised if
this has changed.
I have a table named MyTable, with an AutoNumber field named ID.
Executing this inserts a row with a value of 0 in ID:
INSERT INTO MyTable (ID) VALUES (0)

Correct, you can insert any long integer into an autonumber field in an
empty Access table if the field is a unique index. The table can have any
value inserted in an autonumber field if it is not a unique index (a rare
occurance, but possible).
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top