March 24, 2005 at 9:56 am
I have a stored procedure, which, if an insert fails because the record already exists, performs an update of the record. The code works fine, but an error is still returned back to ColdFusion saying the stored procedure failed. The error was technically handled exactly the way I want to handle it, so I do not want ColdFusion to think that the procedure failed. Is there a way to suppress this error notification?
Thank you,
Mike Chabot
March 24, 2005 at 11:14 am
Why not change the stored-procedure to try and perform the following?
IF EXISTS (SELECT * FROM dbo.table WHERE criteria)
BEGIN
UPDATE...
END
ELSE
BEGIN
INSERT
END
Good Hunting!
AJ Ahrens
webmaster@kritter.net
March 24, 2005 at 3:38 pm
Thank you. I went ahead and changed my stored procedure.
If anyone knows how to suppress an error in SQL Server 2000, I would still be interested to know in case the question comes up in some other context.
Thank you,
Mike Chabot
March 24, 2005 at 3:59 pm
Look at @@ERROR in Books Online. Might give you what you need.
Steve
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply