[AccessD] Create table with autonumber and PK

jwcolby jwcolby at colbyconsulting.com
Fri Jun 11 08:14:35 CDT 2004


Folks,

I have a create table query that creates a table but does not set the PK or
setup the PK as an autonumber.

CREATE TABLE MemberDetails
(
    MemberId integer,
    FirstName varchar(50),
    LastName varchar(50),
    DateOfBirth date,
    Street varchar(100),
    City varchar(75),
    State varchar(75),
    ZipCode varchar(12),
    Email varchar(200),
    DateOfJoining date

)

Is it possible to do this?

The ID should be a long, and should be set as an autonumber, and as the PK.
How do you do that in SQL?

John W. Colby 
www.ColbyConsulting.com





More information about the AccessD mailing list