December 9, 2010 at 7:39 am
Hello guys
I'm hitting a wall here, i have a certain procedure1 call a procedure2 on a linked server. It works well. But when i tried error handling of procedure1 (which calls a write_errorlog, something in the lines of error_message()) the error_message() message in the log is completely different from the one that i get in the Management studio
Question is how do i get the real message?
Message returned by Mananagement studio:
OLE DB provider "DB2OLEDB" for linked server "db2conn" returned message "A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 22012, SQLCODE: -801".
Message in my log
Could not execute statement on remote server 'db2conn'.
Note that the exception is made with intention to check the error handling (its div by zero error)
December 10, 2010 at 2:30 am
I may not have been comprehensive enough.
How do i get OLE DB provider error message and not the SQL server message (read above)
December 10, 2010 at 3:24 am
Without knowing your current code (where did you place the TRY CATCH block?) it's unlikely we can help to solve the issue. So, please post the relevant code snippet.
December 10, 2010 at 5:27 am
the code looks like this
trigger
begin try
transaction
end try
begin catch etc...
But i've just fixed (2 days for such an easy sollution hehe) this by making the DB2 SP return another out which is a DIAGNOSTICS message
Thanks for the help anyway , i hope to return the favor soon
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply