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 |
boboy_ponce
Starting Member
2 Posts |
Posted - 2006-12-18 : 02:58:52
|
Hi All,Im new to MS SQL2000, i have two tables, employee as my masterfile and emp_data as my second tables. I need to create trigger so everytime i delete employees from my masterfile, automatically my delete trigger will fire and delete records from my secondary tables of the same employee id.Your help is highly appreciated.Regards.Boboy Ponce |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-18 : 03:10:40
|
Another way is CASCADE DELETE option, provided you have foreign key relationship between the two tables (and it will be more simpler and faster way!)Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
madhuotp
Yak Posting Veteran
78 Posts |
Posted - 2006-12-18 : 03:12:43
|
There are two ways. (a) Make the Employee -->Emp_data relation as ON Delete Cascade(b) Create a delete triggerRefer both in BOL.Madhu |
|
|
boboy_ponce
Starting Member
2 Posts |
Posted - 2006-12-18 : 03:24:24
|
quote: Originally posted by madhuotp There are two ways. (a) Make the Employee -->Emp_data relation as ON Delete Cascade(b) Create a delete triggerRefer both in BOL.MadhuThanks for your reply.But what is BOL? and where do i get it?Boboy
|
|
|
madhuotp
Yak Posting Veteran
78 Posts |
|
|
|
|