Exception to foreign key constraint

  • We have two tables:

    create table Currency (

    CurrencyID CHAR(3) not null primary key,

    Name varchar(70) not null)

    Create table CurrencyClosed (

    CurrencyID CHAR(3) not null,

    StartDateTime datetime not null,

    EndDateTime datetime not null,

    Desciption varchar(1000) not null)

    Obviously we want this foreign key constraint:

    alter table CurrencyClosed

    add constraint FK_CurrencyClosed__CurrencyID

    foreign key (CurrencyID)

    references Currency(CurrencyID)

    However we also want to have rows in CurrencyClosed that represent when every currency is closed. What is the best method to do this? What are the pros & cons of the various different options?

    - EBH

    If brute force is not working you're not using enough.

  • Create a AFTER TRIGGER for INSERT....or you need to manually insert the rows in currencyclosed table everytime.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply