primary key creation using make table query

  • Thread starter Thread starter Guest
  • Start date Start date
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

After you've run the make-table query, run something like this:

ALTER TABLE table_name ADD CONSTRAINT PK_table_name PRIMARY KEY (col1,
col2)

col1 & col2 are the names of the columns that make up the primary key.
You can use only one column if multiple columns are not required.

IOW, you can't designate any attributes during the make-table query to
add a PK.

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

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

iQA/AwUBQf/uEoechKqOuFEgEQLscgCgsLBdZGvLJMILA2sGcI7VHbM/G0YAn0Q4
s8ruTBXct+/axa8A8RI25xg7
=3U46
-----END PGP SIGNATURE-----
 
Works like a dream thanks.

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

After you've run the make-table query, run something like this:

ALTER TABLE table_name ADD CONSTRAINT PK_table_name PRIMARY KEY (col1,
col2)

col1 & col2 are the names of the columns that make up the primary key.
You can use only one column if multiple columns are not required.

IOW, you can't designate any attributes during the make-table query to
add a PK.

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

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

iQA/AwUBQf/uEoechKqOuFEgEQLscgCgsLBdZGvLJMILA2sGcI7VHbM/G0YAn0Q4
s8ruTBXct+/axa8A8RI25xg7
=3U46
-----END PGP SIGNATURE-----
 
Back
Top