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 |
|
abarsami
Yak Posting Veteran
68 Posts |
Posted - 2001-01-18 : 15:01:31
|
| This is a very simple question. I have one table called table1. In that table I have a Primary_key column and a Foreign_key column that refers to the Primary_key.Pk FK__ __1--NULL2--13--14--35--4I say delete table1 where Pk = 4My Trigger:create trigger tr_table1_don message for deleteasif @@rowcount = 0 return select Pk from deletedreturn What this should do is show me the one's it deleted, but I get a foreign key constraint error, because Row 4 has a foreign key assigned to it -- row 5 refers to row 4. How can say delete row 4 and it automatically deletes row 5 first then goes and deletes row 4.Thx |
|
|
|
|
|