2.2.2.2.1.1.3 sqlbatchResult.SqlMessage

sqlbatchResponse.sqlbatchResult.SqlMessage: This element of complex type SqlMessage describes the portion of the response representing a SQL Server message. This includes server-generated error messages, notifications and user-defined messages. The SqlMessage type is defined under the "http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage" namespace as the following.

            
 <xsd:complexType name="SqlMessage">
   <xsd:sequence minOccurs="1" maxOccurs="1">
     <xsd:element name="Class" 
 type="sqlmessage:nonNegativeInteger" />
     <xsd:element name="LineNumber" 
 type="sqlmessage:nonNegativeInteger" />
     <xsd:element name="Message" type="xsd:string" />
     <xsd:element name="Number" 
 type="sqlmessage:nonNegativeInteger" />
     <xsd:element name="Procedure" 
 type="xsd:string" minOccurs="0" />
     <xsd:element name="Server" 
 type="xsd:string" minOccurs="0" />
     <xsd:element name="Source" type="xsd:string" />
     <xsd:element name="State" 
 type="sqlmessage:nonNegativeInteger" />
   </xsd:sequence>
 </xsd:complexType>
            
 <xsd:simpleType name="nonNegativeInteger">
   <xsd:restriction base="xsd:int">
     <xsd:minInclusive value="0" />
   </xsd:restriction>
 </xsd:simpleType>
            

SqlMessage.Class: This required element of simple type nonNegativeInteger describes the severity level of the server message. The range of values is defined by the server and subject to change, but it MUST be of type XML int. Refer to [MSDN-DEES] for details on the range of values defined by the server.

SqlMessage.LineNumber: This required element of simple type nonNegativeInteger describes the line number in the query that generated the server message. The value range is from 0 to 2147483647.

SqlMessage.Message: This required element of string type describes the text of the server message.

SqlMessage.Number: This required element of simple type nonNegativeInteger describes the identity number of the server message. The set of identity numbers is defined by the server.

SqlMessage.Procedure: This optional element of string type describes the name of the server-side method that generated this server message.

SqlMessage.Server: This optional element of string type describes the name of the server that generated this server message.

SqlMessage.Source: This required element of string type describes the name of the source that generated this server message.<1>

SqlMessage.State: This required element of simple type nonNegativeInteger describes the server state that generated the server message. Some messages apply to multiple server scenarios and this state number is used to identify the scenario that generated the message. The set of state numbers is defined by the server. The value range is from 0 to 2147483647.