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 |
|
liuyang
Starting Member
6 Posts |
Posted - 2003-01-28 : 03:04:12
|
| Dear experts:I just start to learn stored procedure and use it in my projectnow i have a problemthere are three tables course,coursetype,and coursepricehistorythe course table is the parent table to coursetype with the key courseid,and coursetype table is the parent table to coursepricehistoy with the key coursetypepricewhich means one course record may have several coursetype records related to it and one coursetype record may have several courseprice records related to it.what i need to do is when deleting a course record the related coursetype records will be also deleted and the coursepricehistory records related to those coursetype records will also by deleted.so how to do this in one stored procedure?thanks |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2003-01-28 : 03:25:49
|
| Dear beginner!It's obvious that you haven't yet oppened a thing called Books On Line, and it's obvious too that you don't have any experience in administering RDBMS.But it's obvious that you've jumped hedfirst into a project without having knowledge of the simplest functionality of your database server.Anyway, in hope that someday you will find and open the mother of all SQL books, I send you this: "discover the beauty of CASCADE DELETE" |
 |
|
|
liuyang
Starting Member
6 Posts |
Posted - 2003-01-28 : 03:30:02
|
| Thanks for your adviceanyway i will need more advices like this when my project goes on |
 |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2003-01-28 : 03:31:42
|
| Some just don't ever get it... |
 |
|
|
liuyang
Starting Member
6 Posts |
Posted - 2003-01-28 : 03:50:06
|
| Solved |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-01-28 : 08:22:52
|
| Save your breath, rihardh, some people just dont get sarcasm!OS |
 |
|
|
|
|
|