Reply to Self-Reference cascading deletes

Your name:

Reply:


Posted by cesar.guinovart on 08/31/06 15:44

I have the following table

CREATE TABLE [tbl_Items]
(
[item_id] int IDENTITY(1,1) CONSTRAINT PK_tbl_Items__item_id
PRIMARY KEY,
[parent_id] int DEFAULT(NULL) CONSTRAINT
FK_tbl_Items__item_id__parent_id REFERENCES [tbl_Items]( [item_id] ) ON
DELETE NO ACTION ON UPDATE NO ACTION
)


My Intention was to create a table that when I delete a record, all
records that have on the [parent_id] field the deleted record
[item_id].

I am trying to avoid having to use triggers or create a stored
procedure that firsts delete the children (recursively) and then
deletes the parent.

Is there any way to do this by changing my table definition here?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация