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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 create relationship between tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-02 : 07:48:38
adee writes "I'm trying to develop delphi 7 component for relationship between tables using ms-sql server 2000 personal edition an windows xp sp 2, how i create that relationship using sql command only? thanks"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-02 : 07:50:08
ALTER TABLE myTable ADD CONSTRAINT FK_myTable_myOtherTable FOREIGN KEY (col1) REFERENCES myOtherTable (col1)

Something like that would do the trick. For more information, see Books Online under "CREATE TABLE" and "ALTER TABLE".
Go to Top of Page
   

- Advertisement -