Re: Stored Procedure that deletes from multiple tables
Your code looks fine,
when deleteing complete tables you should consider
using TRUNCATE TABLE instead of DELETE
its much faster, however,this will also initialize the
auto number record count and keys so if you have all sorts of restrictions this may not be such a hot idea.
read about it in books online to see if it fits you.
...so your database can't be reliably restored to a point in time after the truncate. If you want recoverability you would need to run a database backup, and that negates the speed advantage of TRUNCATE. It's fine for a development environment, but not for a production system.
Why aren't you using defined referential integrity with automatic cascading of updates and deletes?