sqlserver下Kill 所有连接到某一数据库的连接
时间:2024-01-21 18:05:51
USE master
DECLARE @spid int
DECLARE CUR CURSOR
FOR SELECT spid FROM sysprocesses WHERE dbid = 5
FETCH NEXT FROM CUR INTO @spid
WHILE @@FETCH_STATUS = 0
BEGIN
--EXEC ('KILL ' + @spid )
FETCH NEXT FROM CUR INTO @spid
END
CLOSE CUR
DEALLOCATE CUR
标签:sqlserver,Kill,数据库的连接
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
FireFox浏览器使用Javascript上传大文件
2023-11-17 09:49:27
基于python实现图片转字符画代码实例
2023-05-17 01:53:37
![](https://img.aspxhome.com/file/2023/0/66290_0s.png)
Python获取图像中像素点坐标实例代码
2021-02-20 19:42:05
![](https://img.aspxhome.com/file/2023/4/127864_0s.jpg)
由不同的索引更新解决MySQL死锁套路
2024-01-18 02:03:53
![](https://img.aspxhome.com/file/2023/5/121585_0s.jpg)
MySQL中超级有用的14个小知识总结
2024-01-26 09:01:10
![](https://img.aspxhome.com/file/2023/3/99343_0s.png)
ant-design-vue中的select选择器,对输入值的进行筛选操作
2024-04-26 17:41:26
![](https://img.aspxhome.com/file/2023/5/133125_0s.gif)
js神秘的电报密码 哈弗曼编码实现
2024-04-16 09:13:58
![](https://img.aspxhome.com/file/2023/3/136663_0s.png)
AlternatingItemTemplate类似于 ItemTemplate 元素
2023-07-14 13:09:07
详解Python基础random模块随机数的生成
2021-07-29 08:12:01
vue中项目页面空白但不报错产生的原因及分析
2024-05-03 15:12:17
![](https://img.aspxhome.com/file/2023/8/130188_0s.png)
python中Matplotlib绘制直线的实例代码
2022-09-24 18:27:52
OpenCV 使用imread()函数读取图片的六种正确姿势
2021-07-22 13:01:28
![](https://img.aspxhome.com/file/2023/2/128312_0s.jpg)
Mysql学习之数据库检索语句DQL大全小白篇
2024-01-24 16:52:39
![](https://img.aspxhome.com/file/2023/1/118451_0s.png)
python三元运算符实现方法
2022-08-19 23:11:34
解决大于5.7版本mysql的分组报错Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated
2024-01-16 14:08:53
python绘制彩虹图
2021-10-09 03:07:05
![](https://img.aspxhome.com/file/2023/1/135101_0s.jpg)
设置密码保护的SqlServer数据库备份文件与恢复文件的方法
2024-01-15 10:19:55
OpenCV+python实现实时目标检测功能
2023-11-03 01:59:35
![](https://img.aspxhome.com/file/2023/3/80823_0s.png)
djano一对一、多对多、分页实例代码
2022-11-06 23:05:44
MySQL索引结构详细解析
2024-01-13 19:20:06
![](https://img.aspxhome.com/file/2023/1/85811_0s.png)