RE: how to make a delete statement fail

From: Larry G. Elkins <>
Date: Wed, 26 Aug 2009 22:18:36 -0500
Message-ID: <000c01ca26c5$10c306f0$324914d0$_at_net>

Delete trigger that raises error  

If execution plan uses index for criteria do an alter index xyz unusable, assuming skip_unusable_indexes is false (don't do this if this is a multi-billion row table ;-))    

Larry G. Elkins  

Joe Smith wrote:

How do I make a correct DELETE statement fail? I have a developer that wants to test a code branch and he needs a delete statement to fail.  

It can't be locked ( shared or exclusive ) from a separate session or be an incorrect statement or return "0 rows deleted."  

It has to be "delete from table where col = value". How can I force that to fail?    


Windows Live: Keep your friends up to date with what you do online. Find out more.
< N:WL:en-US:SI_SB_online:082009>

Received on Wed Aug 26 2009 - 22:18:36 CDT

Original text of this message