Hi Mike - thanks for your suggestions.
>I don't quite understand why you're explicitly testing for the FK? DRI will inform you if you try to violate RI. And then there's the performance issues of using Dynamic SQL; as far as SQL Server is concerned, Dynamic is the same as an ad-hoc query.
>
It's a requirement of the system: we have to alert the user as to which tables have an FK reference before attempting a delete.
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.