Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.58 KB

max-connections-transact-sql.md

File metadata and controls

65 lines (50 loc) · 2.58 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
@@MAX_CONNECTIONS (Transact-SQL)
@@MAX_CONNECTIONS (Transact-SQL)
markingmyname
maghan
09/18/2017
sql
t-sql
reference
@@MAX_CONNECTIONS
@@MAX_CONNECTIONS_TSQL
simultaneous connections [SQL Server]
maximum number of simultaneous user connections
@@MAX_CONNECTIONS function
connections [SQL Server], simultaneous
number of simultaneous user connections
TSQL

@@MAX_CONNECTIONS (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Managed Instance]

Returns the maximum number of simultaneous user connections allowed on an instance of [!INCLUDEssNoVersion]. The number returned is not necessarily the number currently configured.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

@@MAX_CONNECTIONS  

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Return Types

integer

Remarks

The actual number of user connections allowed also depends on the version of [!INCLUDEssNoVersion] that is installed and the limitations of your applications and hardware.

To reconfigure [!INCLUDEssNoVersion] for fewer connections, use sp_configure.

Examples

The following example shows returning the maximum number of user connections on an instance of [!INCLUDEssNoVersion]. The example assumes that [!INCLUDEssNoVersion] has not been reconfigured for fewer user connections.

SELECT @@MAX_CONNECTIONS AS 'Max Connections';  

[!INCLUDEssResult]

Max Connections  
---------------  
32767            

See Also

sp_configure
Configuration Functions
Configure the user connections Server Configuration Option