Cascade update / delete in Microsoft access sql editor

Discussion in 'Access' started by Frank Lagan, Jan 14, 2017.

  1. Frank Lagan

    Frank Lagan

    Joined:
    Jan 14, 2017
    Messages:
    2
    Likes Received:
    0
    I want to enforce referential integrity between two related tables using the sql editor. There is very little help available so any help will be gratefully received.
    :)
     
    Frank Lagan, Jan 14, 2017
    #1
    1. Advertisements

  2. Frank Lagan

    Frank Lagan

    Joined:
    Jan 14, 2017
    Messages:
    2
    Likes Received:
    0
    These are the two tables I want to link on CustomerID caascading delete and update.

    CREATE TABLE tblCutsomer
    (
    CustomerID INTEGER CONSTRAINT PK_CustomerID PRIMARY KEY
    );

    CREATE TABLE tblInvoices
    (InvoiceID INTEGER CONSTRAINT PK_InvoiceID PRIMARY KEY,
    CustomerID INTEGER NOT NULL CONSTRAINT FK_CustomerID
    REFERENCES tblCustomers (CustomerID),
    InvoiceDate DATETIME,
    Amount CURRENCY)
     
    Frank Lagan, Jan 15, 2017
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.