Quantcast
Channel: Limno (Jingyang Li) » Access 2007
Viewing all articles
Browse latest Browse all 4

Add an AutoNumber column as primary key field in Access (2003/7) through DDL

$
0
0
Here is the syntax:

Alter TABLE XYZ
Add column myID  COUNTER CONSTRAINT PrimaryKey PRIMARY KEY 

If we want to set the seed for the AutoNumber field, we can run this query:
alter table XYZ
alter column myID Counter(1000,1);

 

There is a documnet from Microsoft to demostrate:

How to Create and Drop Tables and Relationships Using SQL DDL

refer to this link: http://support.microsoft.com/?id=116145

You can also find more information on this topic from this document:

(How to use common Data Definition Language (DDL) SQL statements for the Jet database engine)

http://support.microsoft.com/default.aspx?scid=kb;en-us;180841

 

 



Viewing all articles
Browse latest Browse all 4

Trending Articles