I have a complicated data structure on SQL Server 2000 which, at times can go four levels deep. It is all designed using foreign keys, as expected. I am having difficulty getting deletion to work from the top level, which is an orders table. Some child tables have cascade deletes on, and some are dealt with by native C# code. No matter what I try, it still takes upto fiveminutes to delete an order. Any ideas as to why?
Have you tried to run queries to select each of the rows that need to be deleted in all involved tables ?
Maybe it is taking that long to delete the records because of the lack of appropriate indexes.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 1  Reply