Announcement

Collapse
No announcement yet.

Wie kann ich in MS-Access mit SQL eine Spalte vom Typ AutoWert/Autoinc-Feld anlegen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wie kann ich in MS-Access mit SQL eine Spalte vom Typ AutoWert/Autoinc-Feld anlegen

    Ich möchte in MS-Access mit SQL eine Tabelle mit einer Spalte vom Typ AutoWert/Autoinc-Feld anlegen. Mit dem MS-SQL-Server klappt dies mit folgendem SQL-Cose:

    <PRE>
    CREATE TABLE FoPerson
    (Nr INT AUTOINC NOT NULL,
    .
    .
    .
    PRIMARY KEY (Nr))
    </PRE>

    Wie muss ich die Typdefinition der Spalte ändern, damit dies bei MS-Access auch funktioniert? Ich habe im Internet leider dazu nichts gefunden.

    Vielen Dank für Eure Hilfe

    Viele Grüße

    Claudius Reiner

  • #2
    Hallo,

    das folgende Beispiel stammt aus der Microsoft-Dokumentation <i>The Jet 4.0 ANSI SQL-92 Extensions</i>:
    <pre>
    CREATE TABLE tblNewOrder1 (
    OrderId <b>AUTOINCREMENT</b>,
    ItemId LONG,
    Quantity LONG,
    CONSTRAINT QuantityOnHand CHECK (Quantity <= (
    SELECT QOH
    FROM tblInventory
    WHERE ItemId = tblNewOrder1.ItemId))
    )
    </pre&gt

    Comment


    • #3
      Hallo Herr Kosch

      Vielen Dank
      Claudius Reine

      Comment

      Working...
      X