views:

415

answers:

2

How can I find a list of error codes for sql server, socket exceptions, web exceptions or any exception.

For sql server I am not able to find all the error codes in sysmessages like for instance errorcode 53, 17 so where do we find such codes?

For example System.Net.Sockets.SocketError sockererror is an enum which contains most of the socket errors, is there anything similar to this for sqlclient so tht we can capture sql server errors?

+1  A: 

For SQL-Server, there seems to be a table for which I found a spec on MSDN, or is this what you meant?

SELECT * FROM sysmessages

afaik returns all the error-codes available on an MS SQL Server...

Atmocreations
I think the question author is saying that the sysmessages table does not contain all of the error codes (i.e 53, 17 etc). If I look at the sysmessages table in one of my SQL Server 2005 db's (ordered by the error number) the first error number is 21, followed by 101.
CraigTP
A: 

I can't speak for the other exception types you've listed but the SockException error codes are the same as those defined in Winsock2.h

For a list of Socket error code check out Windows Sockets Error Codes on MSDN: http://msdn.microsoft.com/en-us/library/ms740668%28VS.85%29.aspx

ParmesanCodice