4 messages in com.mysql.lists.plusplusRE: primary key?| From | Sent On | Attachments |
|---|---|---|
| Lisa N. Michaud | 18 Apr 2004 12:59 | |
| Gregory Haley | 18 Apr 2004 14:17 | |
| Lisa N. Michaud | 18 Apr 2004 14:20 | |
| Paolo Brandoli | 19 Apr 2004 00:08 |
| Subject: | RE: primary key?![]() |
|---|---|
| From: | Gregory Haley (gha...@venaca.com) |
| Date: | 04/18/2004 02:17:21 PM |
| List: | com.mysql.lists.plusplus |
Hi,
If you are using a unix system, from the command line you can type the following:
$ mysqldump -d dbase_name table_name
You will see all the column definitions, then the last line defining the columns you should see something like:
PRIMARY KEY (column_1,column_2)
where TABLE_ID is the name of your primary key column. if you have a multiple primary key, each column that makes up the key will be listed separated by commas.
also, if you are in a mysql session, if you describe your table, the primary keys will be listed as follows:
| column_1 | int(11) | | PRI | 0 | | | column_2 | int(11) | | PRI | 0 | |
hope this helps.
ciao! greg.
Gregory Haley Sr. Software Engineer Venaca, Inc. New York, NY, USA
-----Original Message----- From: Lisa N. Michaud [mailto:lmic...@wheatoncollege.edu] Sent: Sunday, April 18, 2004 4:00 PM To: plus...@lists.mysql.com Subject: primary key?
Trying to look this up, but need the answer quick and you folk may be a faster resource -
Is there a quick way to determine what field(s) is/are serving as the primary key for a given table?
--lisa
Lisa N. Michaud, Assistant Professor of Computer Science Department of Mathematics and Computer Science, Wheaton College lmic...@wheatoncollege.edu http://cs.wheatoncollege.edu/lmichaud
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=gha...@venaca.com




