Modifica

Condividi tramite


SqlNotificationSource Enum

Definition

Caution

Use the Microsoft.Data.SqlClient package instead.

Indicates the source of the notification received by the dependency event handler.

public enum class SqlNotificationSource
public enum SqlNotificationSource
[System.Obsolete("Use the Microsoft.Data.SqlClient package instead.")]
public enum SqlNotificationSource
type SqlNotificationSource = 
[<System.Obsolete("Use the Microsoft.Data.SqlClient package instead.")>]
type SqlNotificationSource = 
Public Enum SqlNotificationSource
Inheritance
SqlNotificationSource
Attributes

Fields

Name Value Description
Client -2

A client-initiated notification occurred, such as a client-side time-out or as a result of attempting to add a command to a dependency that has already fired.

Unknown -1

Used when the source option sent by the server was not recognized by the client.

Data 0

Data has changed; for example, an insert, update, delete, or truncate operation occurred.

Timeout 1

The subscription time-out expired.

Object 2

A database object changed; for example, an underlying object related to the query was dropped or modified.

Database 3

The database state changed; for example, the database related to the query was dropped or detached.

System 4

A system-related event occurred. For example, there was an internal error, the server was restarted, or resource pressure caused the invalidation.

Statement 5

The Transact-SQL statement is not valid for notifications; for example, a SELECT statement that could not be notified or a non-SELECT statement was executed.

Environment 6

The run-time environment was not compatible with notifications; for example, the isolation level was set to snapshot, or one or more SET options are not compatible.

Execution 7

A run-time error occurred during execution.

Owner 8

Internal only; not intended to be used in your code.

Remarks

The SqlNotificationSource enumeration is referenced by an instance of the SqlNotificationEventArgs class.

Query notifications are supported only for SELECT statements that meet a list of specific requirements. For more information, see SQL Server Service Broker and Working with Query Notifications.

Applies to

See also