-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Easiest:
1) Open the table in design view.
2) Drag over the record selectors (square blocks to the left of the
column name) of the 2 columns you want as PKs; or, hold down Ctrl &
click the record selectors of the columns you want as PKs.
3) On the main menu click Edit > Primary Key.
4) Close & Save the table.
a) If there is duplicate data in the PK columns you will not be able
to save the new table design.
SQL DDL:
ALTER TABLE table_name
ADD CONSTRAINT PK_table_name (StudentID, CourseID)
Put the above in a Query's SQL view & run it. Number 4), above,
applies: the DDL statement will fail.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQfHGNYechKqOuFEgEQJ8VgCbB/eeBdagCUjEQG/jR+J1snlAwQIAoPt7
cd/TKbAKgkv7dM4eREPoNy75
=ygN8
-----END PGP SIGNATURE-----
Joe wrote:
I have a table with a student id and course id. I would like to make
both fields the primary key since a student can have multiple course
ids but I do not want duplicate records.
How would I go about creating the multiple field PK in Access 2003?
Thanks!