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 |
|
rn5a
Starting Member
25 Posts |
Posted - 2008-10-31 : 05:04:56
|
| I have 2 tables - Table1 & Table2. There is a column named Col1 in both the tables. Col1 is the PRIMARY KEY in Table1. I want Col1 in Table2 to be the FOREIGN KEY of this PRIMARY KEY column.How do I make Col1 in Table2 the FOREIGN KEY using the ALTER TABLE statement?Thanks,Ron |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-31 : 05:30:10
|
| alter table table2add constraint fk foreign key(col1) references table1(col1)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|