sql server passing error to application -
I have to pass the error in the application. I have written the stored procedures below: Does this error in application or do we need to do anything else?
Example.
Enter the insert_emp Emp values (..........) to initiate the process; insert the tran in the comma; Finally try to catch if @@ Tranquil> 0 rollback declared @armesaj varchar (2000), announcing @Ermember Int @Ermessage = error_mess (), @Ernumber = ERR_Number () Researcher (@Erm Message, @Ernumber, 1) End Catch
< P> If there is no error and no error number, if I have an error then 0 need to pass, so how can it be done to raise? How can we use the racer to log the error incorrectly? More important things can be done eg. Pass error in an application?
Do not pass raiserror (@ eramsase, @forenber, 1)
. There are logic messaging IDs, for severity , you are passing @armanber for the position severity , which is wrong.
You should instead raise a custom error and include the exception message caught in the error message as a message format:
Ricester (N'nirt_amp: Error% i: % S ', 16, 1, @Ernumber, @Ermessage);
You should use Intensity 16 for errors that want to throw SqlException into client-side processing (or other exception, according to the use of client access technology).
For informational messages you must use Seriousness 1.
Comments
Post a Comment