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

1. 查询最大连接数

SELECT value_in_use
FROM sys.configurations c
WHERE 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 OVERRIDE
GO

exec sp_configure 'user connections', 300
GO

RECONFIGURE WITH OVERRIDE
GO

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

1. 查询最大连接数

SELECT value_in_use
FROM sys.configurations c
WHERE 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 OVERRIDE
GO

exec sp_configure 'user connections', 300
GO

RECONFIGURE WITH OVERRIDE
GO

相关文章:

  • 2022-01-25
  • 2022-03-08
  • 2021-09-20
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2021-05-29
  • 2021-11-19
  • 2022-12-23
  • 2022-01-16
  • 2022-02-06
相关资源
相似解决方案