July 19, 2010 at 3:19 pm
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
July 19, 2010 at 3:58 pm
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