Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
roshana
Starting Member
31 Posts |
Posted - 2009-12-01 : 03:37:09
|
| Hi All, How to set foreign key to a table which is having multi value primary keyeg :Table1zyz pkxyz pkabc bcdTable2zyz fkxyz fkasd PKdfgin Table1 zyz,xyz are the primary keys .In Table2 asd is Primary key and we have to set a relation with Table1 for zyz,xyz how we can do itThanksRoshana |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-12-01 : 09:16:13
|
| [code]create table t1 ( a int not null, b int not null, c char(1), Constraint PK_t1 Primary Key (a, b));GOCreate Table t2 ( a int, b int, c int, Constraint FK_t2_t1 Foreign Key (a, b) References t1 (a, b));GO[/code] |
 |
|
|
|
|
|