Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Primary Key in Access ändern (https://www.delphipraxis.net/77248-primary-key-access-aendern.html)

Andi_j62 16. Sep 2006 21:33

Datenbank: Access • Version: 2000 • Zugriff über: SQL

Primary Key in Access ändern
 
Hallo Zusammen,

ich habe das Problem dass ich in einer Tabelle bereits einen Primary Key mit einem Feld definiert habe und jetzt ein 2. Feld dem Primary Key dazufügen muss um eine Eindeutigkeit zu bekommen.

Kann mir bitte jemand mit der entsprechenden SQL-Anweisung unter die Arme greifen? Ich habe schon etliches probiert, es funktioniert aber nicht.

Viele Grüße Andi

mkinzler 16. Sep 2006 21:48

Re: Primary Key in Access ändern
 
Ich kenne mich in Access nicht so aus aber entweder alterante constraint oder halt drop/add constraint.

Andi_j62 16. Sep 2006 21:55

Re: Primary Key in Access ändern
 
Ich dachte ich lösche den Key erstmal mit "ALTER TABLE a_kopf DROP PRIMARY KEY".

Dann kommt aber eine Exception mit der Meldung "Syntax Fehler in ALTER Table Anweisung"

marabu 16. Sep 2006 22:20

Re: Primary Key in Access ändern
 
Hallo,

ich würde es mit DROP INDEX und CREATE INDEX probieren.

Grüße vom marabu


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:30 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz