I'm trying to set a primary key in the queries tab of Access.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to set a primary key in the queries tab of Access? I would
like to set the primary key before I run my select query or make-table query.
Is there a way to do this without having to go into the tables tab of the
database window? A clue in the right direction would be very appreciated.

Thank you.
 
The said:
Is there a way to set a primary key in the queries tab of Access? I would
like to set the primary key before I run my select query or make-table query.
Is there a way to do this without having to go into the tables tab of the
database window? A clue in the right direction would be very appreciated.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Primary Keys cannot be created in a make-table query. Nor, can you
"set" a PK in a SELECT query. PKs can be assigned to existing tables by
using Data Definition Language (DDL). E.g.:

ALTER TABLE <table name>
ADD CONSTRAINT <constraint name> PRIMARY KEY (<column> [, column])

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQh7a0IechKqOuFEgEQKhbgCeJfCZT/Mqoj+OtydrXIxIqrRaaP0Anjgh
+oXXwZ62zFj2NaY7jMk2OZfh
=MKKD
-----END PGP SIGNATURE-----
 
Back
Top