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 |
|
jennypretty
Yak Posting Veteran
96 Posts |
Posted - 2004-10-22 : 10:23:52
|
| CREATE TABLE EMP(EMP_ID VARCHAR(20),EMP_DEPT NUMERICCONSTRAINT EMP_PK PRMARY KEY(EMP_ID),CONTRAINT EMP_FK FOREIGN KEY(EMP_DEPT) REFERENCES DEPT)GONOW, How do I alter this table FK to point to SALARY table?CONTRAINT EMP_FK FOREIGN KEY(EMP_DEPT) REFERENCES SALARY)THANKS.JENNYThe stupid question is the question you don't ask.www.single123.com |
|
|
surefooted
Posting Yak Master
188 Posts |
Posted - 2004-10-22 : 11:18:38
|
[code]Alter Table EMPDROP CONSTRAINT EMP_FKAlter TAble EMPADD CONSTRAINT EMP_FK FOREIGN KEY(EMP_DEPT) REFERENCES SALARY(EMP_DEPT)[/code]-JonShould still be a "Starting Member" . |
 |
|
|
jennypretty
Yak Posting Veteran
96 Posts |
Posted - 2004-10-22 : 11:45:46
|
| Woh, it worked. Thanks so much, surefooted.Jenny.The stupid question is the question you don't ask.www.single123.com |
 |
|
|
surefooted
Posting Yak Master
188 Posts |
Posted - 2004-10-22 : 11:58:57
|
No problem. -JonShould still be a "Starting Member" . |
 |
|
|
|
|
|