How do I do a delete from a table like this...
Posted on 2007-10-01
I have a table called AssetLocation. It holds a tree. It has a field called Id, and one called ParentId. If you delete a row, then you need to delete all rows that have their parentid equalling that id. Of course this means recursion.
I've never written a trigger, and not even sure how to do it. I figured that I'd say that cause I feel that is what people are going to tell me to do. I tried database diagrams, but it had the cascade delete options greyed out on this kinda relationship.
So is this easy or difficult, and an example would be incredibly awesome.