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 |
|
richardlaw
Yak Posting Veteran
68 Posts |
Posted - 2009-01-15 : 18:26:26
|
| HiI'm relatively new to MS SQL, I know a bit, but not masses.I've slowly created a database (MS SQL 2005) with a number of tables and views. Most of the database centres on gymnasts, so there are classes, competitions, coaches etc - all revolving around a gymnast.What I need to know, is when I delete a gymnast, I need to also delete all references in other tables (where gymnastID = x). What is the easiest way to do this? Can someone please show me an example?Many thanksRichardRichard Law |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-15 : 18:31:23
|
| Do you mean ON DELETE CASCADE? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
richardlaw
Yak Posting Veteran
68 Posts |
Posted - 2009-01-15 : 18:34:22
|
| Hi TaraHow does the foreign key work? How do I go about setting it up?ThanksRichard |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-15 : 20:26:29
|
| http://www.mssqltips.com/tip.asp?tip=1296 |
 |
|
|
|
|
|