SQLServer查看及设置最大连接数(转)

mac2022-06-30  131

转自:https://blog.csdn.net/duanbeibei/article/details/86573840

很多时候自己本地开发会遇到 ,打开几个连接正常访问 之后就报错误,这时候需要调整sqlserver 最大连接数.

1. 查询最大连接数

SELECT value_in_useFROM sys.configurations cWHERE c.name = 'user connections'; 默认值为:0,即无限制。

2. 查询当前连接数

select count(distinct(login_time)) from sys.sysprocesses 3. 设置最大连接数

exec sp_configure 'show advanced options', 1 GO

RECONFIGURE WITH OVERRIDEGO

exec sp_configure 'user connections', 300GO

RECONFIGURE WITH OVERRIDEGO设置过后需要重启数据库才会生效。

转载于:https://www.cnblogs.com/GarfieldTom/p/11592927.html

最新回复(0)