We are using SQL Server 7, and need to delete records. However, we need to
intercept if a foriegn key constraint error is thrown. SQL Server seems to
be throwing an exception as soon as the error is encountered, and not giving
our script a chance to handle the error.
Is there anyway around this? Other than checking the foriegn key tables
first that is...
here's what we are trying thus far:
-- delete the line item
delete Invoice_Line_Item
Where Invoice_Line_Item_ID = @Line_Item_ID
set @Error = @@error
if @Error <> 0
begin
-- an error has occured while deleting
print @Error
return @Error
end
- An exception is being thrown before the Print statement, we need to avoid
the exception.
Thanks.
Shawn Grover
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists