다음을 통해 공유


ServerMessage Event

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The ServerMessage event occurs when a Microsoft SQL Server success-with-information message is returned to the SQL Distributed Management Objects (SQL-DMO) application.

구문

Private Sub
object
_ServerMessage(
Severity as Long
,
MessageNumber as Long
,
MessageState as Long
,
Message as String
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Severity
    Long integer that identifies the severity level of a SQL Server error message.

  • MessageNumber
    Long integer that identifies a SQL Server error message by number.

  • MessageState
    Long integer that identifies a state value for a SQL Server error message.

  • Message
    String that contains SQL Server error message text.

Prototype (C/C++)

HRESULT ServerMessage(long Severity, long MessageNumber,
long MessageState, SQLDMO_LPCSTR Message);

주의

For SQL Server, error severity indicates the degree of an error condition. Some errors are severe enough to terminate statement execution prematurely. Any error with a severity of 10 or higher is returned to the SQL-DMO application through normal error handling.

More benign errors indicate that statement execution succeeded, but that success was conditional. Success-with-information errors, called messages, are SQL Server errors with a severity of less than 10. Some Transact-SQL statements, such as the PRINT statement, do not generate result sets, using messages for their return value.

Implement a ServerMessage event handler to capture SQL Server messages raised by SQL-DMO application processing.

Applies To: