cluster indexes

  • Hi

    i've this scenario:

    I have two tables:

    table 1:

    contnume

    emprnume

    name

    last name

    clustered index contnume + emprnume

    primary key contnume + emprnume

    table 2:

    factnume

    contnume

    emprnume

    value

    what i need to do is to have unique contnume (bill number) for a given emprnume (company) and a unique factnume (receipts) for a given contnume + emprnume.

    in other words I have many companies in both tables with unique bill numbers and receipts for a given company but non unique in the table.

    for example:

    company 1 bill# 1 receipt #1

    company 1 bill#2 receipt #2

    company 2 bill# 1 receipt #1

    company 2 bill#2 receipt #2

    how can I do that?

    thanks in advance

    Edotom

  • You can create unique indexes on these fields, that do not need to be PKs or FKs.

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

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