You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns a row containing dynamic-state information for each TCP listener.
26
-
27
-
> [!NOTE]
28
-
> The availability group listener could listen to the same port as the listener of the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. In this case, the listeners are listed separately, the same as for a Service Broker listener.
|**listener_id**|**int**|Listener's internal ID. Is not nullable.<br /><br /> Primary key.|
33
-
|**ip_address**|**nvarchar(48)**|The listener IP address that is online and currently being listening to. Either IPv4 and IPv6 is allowed. If a listener possesses both types of addresses, they are listed separately. An IPv4 wildcard, is displayed as "0.0.0.0". An IPv6 wildcard, is displayed as "::".<br /><br /> Is not nullable.|
34
-
|**is_ipv4**|**bit**|Type of IP address<br /><br /> 1 = IPv4<br /><br /> 0 = IPv6|
35
-
|**port**|**int**|The port number on which the listener is listening. Is not nullable.|
36
-
|**type**|**tinyint**|Listener type, one of:<br /><br /> 0 = [!INCLUDE[tsql](../../includes/tsql-md.md)]<br /><br /> 1 = Service Broker<br /><br /> 2 = Database mirroring<br /><br /> Is not nullable.|
37
-
|**type_desc**|**nvarchar(20)**|Description of the **type**, one of:<br /><br /> TSQL<br /><br /> SERVICE_BROKER<br /><br /> DATABASE_MIRRORING<br /><br /> Is not nullable.|
38
-
|**state**|**tinyint**|State of the availability group listener, one of:<br /><br /> 1 = Online. The listener is listening and processing requests.<br /><br /> 2 = Pending restart. the listener is offline, pending a restart.<br /><br /> If the availability group listener is listening to the same port as the server instance, these two listeners always have the same state.<br /><br /> Is not nullable.<br /><br /> Note: The values in this column come from the TSD_listener object. The column does not support an offline state because when the TDS_listener is offline, it cannot be queried for state.|
39
-
|**state_desc**|**nvarchar(16)**|Description of **state**, one of:<br /><br /> ONLINE<br /><br /> PENDING_RESTART<br /><br /> Is not nullable.|
40
-
|**start_time**|**datetime**|Timestamp indicating when the listener was started. Is not nullable.|
41
-
42
-
## Permissions
43
-
Requires VIEW SERVER STATE permission on the server.
44
-
45
-
### Permissions for SQL Server 2022 and later
46
-
47
-
Requires VIEW SERVER SECURITY STATE permission on the server.
48
-
49
-
## See also
50
-
[Querying the SQL Server System Catalog FAQ](../../relational-databases/system-catalog-views/querying-the-sql-server-system-catalog-faq.yml)
51
-
[Always On Availability Groups Catalog Views (Transact-SQL)](../../relational-databases/system-catalog-views/always-on-availability-groups-catalog-views-transact-sql.md)
52
-
[Always On Availability Groups Dynamic Management Views and Functions (Transact-SQL)](../../relational-databases/system-dynamic-management-views/always-on-availability-groups-dynamic-management-views-functions.md)
53
-
54
-
26
+
Returns a row containing dynamic-state information for each TCP listener.
27
+
28
+
> [!NOTE]
29
+
> The availability group listener could listen to the same port as the listener of the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. In this case, the listeners are listed separately, the same as for a Service Broker listener.
30
+
31
+
| Column name | Data type | Description |
32
+
| --- | --- | --- |
33
+
|`listener_id`|**int**| Listener's internal ID. Not nullable.<br /><br />Primary key. |
34
+
|`ip_address`|**nvarchar(48)**| The listener IP address that's online and currently being listening to. Can be either `IPv4` or `IPv6`. If a listener possesses both types of addresses, they're listed separately. An IPv4 wildcard is displayed as `0.0.0.0`. An IPv6 wildcard is displayed as `::`.<br /><br />Not nullable. |
35
+
|`is_ipv4`|**bit**| Type of IP address. One of:<br /><br />`1` = IPv4<br />`0` = IPv6 |
36
+
|`port`|**int**| The port number on which the listener is listening. Not nullable. |
|`type_desc`|**nvarchar(20)**| Description of the `type`, one of:<br /><br />`TSQL`<br />`SERVICE_BROKER`<br />`DATABASE_MIRRORING`<br /><br />Not nullable. |
39
+
|`state`|**tinyint**| State of the availability group listener, one of:<br /><br />`0` = Online. The listener is listening and processing requests.<br />`1` = Pending restart. the listener is offline, pending a restart.<br /><br />If the availability group listener is listening to the same port as the server instance, these two listeners always have the same state.<br /><br />Not nullable.<br /><br />**Note:** The values in this column come from the `TSD_listener` object. The column doesn't support an offline state because when the `TDS_listener` is offline, it can't be queried for state. |
40
+
|`state_desc`|**nvarchar(16)**| Description of `state`, one of:<br /><br />`ONLINE`<br />`PENDING_RESTART`<br /><br />Not nullable. |
41
+
|`start_time`|**datetime**| Timestamp indicating when the listener was started. Not nullable. |
42
+
43
+
## Permissions
44
+
45
+
[!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and earlier versions require `VIEW SERVER STATE` permission on the server.
46
+
47
+
[!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions require `VIEW SERVER SECURITY STATE` permission on the server.
48
+
49
+
## Related content
50
+
51
+
-[Querying the SQL Server System Catalog FAQ](../system-catalog-views/querying-the-sql-server-system-catalog-faq.yml)
52
+
-[Always On Availability Groups Catalog Views (Transact-SQL)](../system-catalog-views/always-on-availability-groups-catalog-views-transact-sql.md)
53
+
-[Always On Availability Groups Dynamic Management Views - Functions](always-on-availability-groups-dynamic-management-views-functions.md)
0 commit comments