Link to home
Start Free TrialLog in
Avatar of panJames
panJames

asked on

Relationship question

Hello experts!

I have a table of users:

USERS
id
name
surname

Users are allowed to sell things to each other.

I need a table to record sales data between users.

SALES
id
buyerFK foreign key to USERS.id
sellerFK foreign key to USERS.id
price

problem is that my database which is SQL Server express does not allow me to have two foreign keys pointing to the same table (USERS).

How can I solve this problem please?

Thank you

panJames
SOLUTION
Avatar of Thomasian
Thomasian
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are you attempting to use the ON Delete or On Update?
These have been know to cause problems in SQL Server Express for this type of relationship.

As indicated by Thomasian, would need to see the error to understand further.
Avatar of panJames
panJames

ASKER

I am using WebMatrix, it allows me to create tables and relationships in its own tool.

Are you guys saying that it is possible to have such relations?

Maybe it is some king of limitation of webmatrix?

panJames
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Stupid me: all I had to do was to change the name.

THX!