Composite keys as Foreign Key?
Posted
by paulio
on Stack Overflow
See other posts from Stack Overflow
or by paulio
Published on 2010-05-26T15:56:40Z
Indexed on
2010/05/26
16:01 UTC
Read the original article
Hit count: 285
sql-server
|sql-server-2008
I have the following table...
TABLE: Accounts
ID (int, PK, Identity)
AccountType (int, PK)
Username (varchar)
Password (varchar)
I have created a composite key out of ID and AccountType columns so that people can have the same username/password but different AccountTypes.
Does this mean that for each foreign table that I try and link to I'll have to create two columns?
I’m using SQL Server 2008
© Stack Overflow or respective owner