DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ALTER TABLE

  1. #1
    tom Guest

    ALTER TABLE


    I want to remove the primary key in a Ms Access table.
    I tried "ALTER TABLE DROP CONTRAINT PRIMARY KEY", but error occur, could
    anyone pls tell me what's wrong with it?

  2. #2
    Filipo Novo Mór Guest

    Re: ALTER TABLE


    "tom" <tom.com@asia.com> wrote:
    >
    >I want to remove the primary key in a Ms Access table.
    >I tried "ALTER TABLE DROP CONTRAINT PRIMARY KEY", but error occur, could
    >anyone pls tell me what's wrong with it?


    Tom,

    The command you're trying is not correct. You have to declare the constraint's
    name used to form the primary key. For sample:

    ALTER TABLE TAB1 DROP CONSTRAINT Fk_Tab1;

    Is the correct command to drop the primary key of a tab (Tab1) created
    this way:

    CREATE TABLE Tab1
    (
    field1 integer not null,
    field2 text,
    constraint Fk_Tab1 primary key (field1)
    )

    I hope it helps! :-)

    Filipo



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center