jwcolby
jwcolby at colbyconsulting.com
Fri Jun 11 09:13:29 CDT 2004
Syntax off just slightly - CONSTRAINT PrimaryKey PRIMARY KEY(MEMBERID); That sets the field to PK, but it is still an integer, not an autonumber. John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys Sent: Friday, June 11, 2004 9:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Create table with autonumber and PK John, Does this work? If not, would you take the code solution? 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, CONSTRAINT PrimaryKey PRIMARY KEY(ID); ) Michael R. Mattys (724) 942-3437 Mattys MapLib for Microsoft MapPoint http://www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" <jwcolby at colbyconsulting.com> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Sent: Friday, June 11, 2004 9:14 AM Subject: [AccessD] Create table with autonumber and PK > 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 > > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com