| Posted by David Portas on 11/10/05 14:43 
Foreign key constraints are the method used to enforce relationshipsbetween tables. You can create a foreign key like this:
 
 ALTER TABLE table1
 ADD CONSTRAINT fk_table1_table2
 FOREIGN KEY (col1) REFERENCES table2 (col1) ;
 
 It is also possible to do it through Enterprise Manager although that's
 not something you should ever do on a live database - only use EM on a
 development system.
 
 For a database with hundreds of tables you will probably want to use a
 ER modelling tool to help with the creation of keys. Visio Enterprise
 Architect for example.
 
 --
 David Portas
 SQL Server MVP
 --
  Navigation: [Reply to this message] |