Create Table with Incremental Primary Key with Access

August 02, 2007

Create Table with Incremental Primary Key

Create Table [Courses] (
	[course_id] Counter NOT NULL,
	[course_title] text(100) NOT NULL,
	[course_date] datetime NOT NULL,
	[course_description] memo NOT NULL,
	[course_places] int NOT NULL,
	[course_active] yesno not null,
	[course_created] timestamp NOT NULL,
	[course_location_id] int NOT NULL,
	foreign key (course_location_id) references locations(location_id),
	Primary Key (course_id)
)

2 comments

  1. Nice, just what I did need, thanks :)

    Comment by Henrik – June 16, 2008
  2. @Henrik, You're welcome :)
    It's one of those things that Access does differently to every other database!

    Comment by John Whish – June 16, 2008

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.