Re: Altering Table - Adding Primary Key With References
From: Dan Freeman (spam_at_microsoft.com)
Date: 09/02/04
- Previous message: Sietse Wijnker: "Re: Altering Table - Adding Primary Key With References"
- In reply to: Mikhail: "Altering Table - Adding Primary Key With References"
- Next in thread: Anders Altberg: "Re: Altering Table - Adding Primary Key With References"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 2 Sep 2004 10:33:59 -0700
In addition to what Sietse has to say, if the field is in another table it
is by definition a FOREIGN KEY, not a PRIMARY KEY.
Dan
Mikhail wrote:
> Can i, using alter table command, add primary key, which refers to a
> field in other table?
>
> VFP Help Citation:
>
> ALTER TABLE TableName1 [DROP [COLUMN] FieldName3]
> ...
> [ADD PRIMARY KEY eExpression3 [FOR lExpression4] TAG TagName2
> [COLLATE cCollateSequence]]
>
> In CREATE TABLE a can add primary key, which refers to field in
> another table, but can't specify TAG for field which name is longer
> that 10 chars :
>
> VFP Help Citation:
>
> CREATE TABLE | DBF TableName1 [NAME LongTableName] [FREE]
> ( FieldName1
> ...
> [PRIMARY KEY | UNIQUE [COLLATE cCollateSequence]]
> [REFERENCES TableName2 [TAG TagName1]] [NOCPTRANS])
- Previous message: Sietse Wijnker: "Re: Altering Table - Adding Primary Key With References"
- In reply to: Mikhail: "Altering Table - Adding Primary Key With References"
- Next in thread: Anders Altberg: "Re: Altering Table - Adding Primary Key With References"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|