SQLClient What error numbers are associated with SQL Server connection errors so I can try again

I am getting the following error with SQLClient, are there more errors than the error number: -1, 53, 2?

Error number: -1, Level: 20, State: 0, Line: 0; Message: A network related or instance specific error while creating a connection to SQL Server. The server was not found or was not available. Make sure the instance name is correct and that the SQL Server is configured to allow remote connections. (Provider: SQL Network Interfaces, Error: 26 - Server / Instance Localization Error Specified)

Error number: 53, Level: 20, State: 0, Line: 0; Message: A network related or instance specific error while creating a connection to SQL Server. The server was not found or was not available. Make sure the instance name is correct and that the SQL Server is configured to allow remote connections. (Provider: Named Pipes Provider, Error: 40 - Failed to open connection to SQL Server)

Error number: 2, Level: 20, State: 0, Line: 0; Message: A network related or instance specific error while creating a connection to SQL Server. The server was not found or was not available. Make sure the instance name is correct and that the SQL Server is configured to allow remote connections. (Provider: Named Pipes Provider, Error: 40 - Failed to open connection to SQL Server)

+3


source to share


2 answers


Please try the following link for error information

http://technet.microsoft.com/en-us/library/cc645611(v=sql.105).aspx



Error codes are returned by the db server for the SQL client.

-1


source


The rules I use for general classification are:

  • Number = -1 OR Class / Level / Level = 20: "Connection error"

  • Number = -2: "Command timeout error"

I believe negative values ​​are in strict accordance with the client library (e.g. network connectivity issues); this means that "duplicate" numbers such as 2 and 53 are returned from the server itself for semi-joins.

Other errors (eg deadlocks / 1205) can be more easily identified using the number.




As in the other answer, there is also a link to various links here:

+1


source







All Articles