Hi,
I need to catch the SQL error messages, generated while executing a query.
Basically with reference to the Error Number, I can get the message from
sysmessages table. But that would be a raw one.
For ex, that would be like :
Must declare the variable '%.*ls'.
But normally the error message will be displayed as :
Must declare the variable '@Name'
I want to catch this error message in a variable and log into my table.
Looking for your help. Appreciate it.

Signature
Kathiravan Manimozhi
Senior Programmer
Accenture Services Pvt. Ltd.,
Mumbai - 400079
India.
Ed - 30 Oct 2005 05:49 GMT
Kathir,
You may want to look at FormatMessage in BOL
HTH
Ed
> Hi,
> I need to catch the SQL error messages, generated while executing a query.
[quoted text clipped - 8 lines]
>
> Looking for your help. Appreciate it.
Kathir - 31 Oct 2005 14:09 GMT
Thanks Ed.
But the problem is i don't know what the error number would be and i don't
know what the values i need to pass for the placeholders. All i need is a
generalized method which will catch the complete error message thrown by SQL.

Signature
Kathiravan Manimozhi
Senior Programmer
Accenture Services Pvt. Ltd.,
Mumbai - 400079
India.
> Kathir,
> You may want to look at FormatMessage in BOL
[quoted text clipped - 13 lines]
> >
> > Looking for your help. Appreciate it.