Module com.microsoft.sqlserver.jdbc
Package com.microsoft.sqlserver.jdbc

# Class SQLServerError

java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerError

All Implemented Interfaces:
  `Serializable`

public final class SQLServerError extends Object implements Serializable
SQLServerError represents a TDS error or message event.

See Also:
  - Serialized Form

## Method Summary

Modifier and Type
Method
Description
`String`
`getErrorMessage()`
Returns error message as received from SQL Server
`int`
`getErrorNumber()`
Returns error number as received from SQL Server
`int`
`getErrorSeverity()`
Returns Severity of error (as int value) as received from SQL Server
`int`
`getErrorState()`
Returns error state as received from SQL Server
`long`
`getLineNumber()`
Returns line number where the error occurred in Stored Procedure returned by `getProcedureName()` as received from SQL Server
`String`
`getProcedureName()`
Returns name of the stored procedure where exception occurs as received from SQL Server
`String`
`getServerName()`
Returns name of the server where exception occurs as received from SQL Server

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getErrorMessage

public String getErrorMessage()
Returns error message as received from SQL Server

Returns:
  Error Message

### getErrorNumber

public int getErrorNumber()
Returns error number as received from SQL Server

Returns:
  Error Number

### getErrorState

public int getErrorState()
Returns error state as received from SQL Server

Returns:
  Error State

### getErrorSeverity

public int getErrorSeverity()
Returns Severity of error (as int value) as received from SQL Server

Returns:
  Error Severity

### getServerName

public String getServerName()
Returns name of the server where exception occurs as received from SQL Server

Returns:
  Server Name

### getProcedureName

public String getProcedureName()
Returns name of the stored procedure where exception occurs as received from SQL Server

Returns:
  Procedure Name

### getLineNumber

public long getLineNumber()
Returns line number where the error occurred in Stored Procedure returned by `getProcedureName()` as received from SQL Server

Returns:
  Line Number