Re: Altering Table - Adding Primary Key With References

From: Dan Freeman (spam_at_microsoft.com)
Date: 09/02/04

  • Next message: Mikhail: "Re: Altering Table - Adding Primary Key With References"
    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])


  • Next message: Mikhail: "Re: Altering Table - Adding Primary Key With References"

    Relevant Pages

    • Altering Table - Adding Primary Key With References
      ... VFP Help Citation: ... In CREATE TABLE a can add primary key, which refers to field in another ... [PRIMARY KEY | UNIQUE [COLLATE cCollateSequence]] ...
      (microsoft.public.fox.vfp.dbc)
    • Re: Is there a way to do "save as" a new record in a form?
      ... refers to "the form that this code is part of". ... control to whatever control on *your* form contains the Primary Key ... John W. Vinson ...
      (microsoft.public.access.formscoding)
    • LINKING TABLES
      ... 1.linking tables refers to tables in other dbs so you wont ... 2.yes a primary key is a good idea. ...
      (microsoft.public.access.gettingstarted)
    • Re: join using like returns no row (SQL Server 7)
      ... Thanks for the input Dan, once you know something should work it's easier to ... It's something to do with a.col1 being the primary key. ... "Dan Guzman" wrote: ... >> SQL Server handles the join but makes no difference. ...
      (microsoft.public.sqlserver.programming)
    • count three values in multiple fields
      ... I have a table that stores a number (primary key), a name, and 26 ... 111112 Dan y y y y na y n ... information I need if I create a query that only uses one of the ...
      (microsoft.public.access.queries)

    Loading