[AccessD] Create table with autonumber and PK

jwcolby jwcolby at colbyconsulting.com
Fri Jun 11 09:39:01 CDT 2004


Access used AUTOINCREMENT just fine, but SQL Server didn't pick it up as a
keyword.

John W. Colby 
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Garraway, Alun
Sent: Friday, June 11, 2004 10:09 AM
To: Access Developers discussion and problem solving
Subject: AW: [AccessD] Create table with autonumber and PK


Autonumber is AUTOINCRMENT in SQL

-----Ursprüngliche Nachricht-----
Von: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]Im Auftrag von jwcolby
Gesendet: Freitag, 11. Juni 2004 15:15
An: 'Access Developers discussion and problem solving'
Betreff: [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






More information about the AccessD mailing list