当前位置:网站首页>解决SQL Server数据库独占的问题
解决SQL Server数据库独占的问题
2022-07-28 16:20:00 【mojocube】
use master
go
declare @dbname varchar(20)
set @dbname='OA' ---这是数据库名称
declare @sql nvarchar(500)
declare @spid int--SPID 值是当用户进行连接时指派给该连接的一个唯一的整数
set @sql='declare getspid cursor for
select spid from sysprocesses where dbid=db_id('''[email protected]+''')'
exec (@sql)
open getspid
fetch next from getspid into @spid
while @@fetch_status<>-1--如果FETCH 语句没有执行失败或此行不在结果集中。
begin
exec('kill '[email protected])--终止正常连接
fetch next from getspid into @spid
end
close getspid
deallocate getspid
边栏推荐
- Comprehensively design an oppe homepage -- page service part
- Deep understanding of deepsea and salt deployment tools – storage6
- Question making note 2 (add two numbers)
- 全链路灰度在数据库上我们是怎么做的?
- The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
- 微信小程序现金红包返回“IP地址非你在商户平台设置的可用IP地址”错误终极解决方法
- Jupyter notebook win installation record
- 如何在构建阶段保护镜像安全
- Reasoning Over Semantic-Level Graph for Fact Checking
- Unity shader transparent effect
猜你喜欢

Analysis of browser decoding process

Fine-grained Fact Verification with Kernel GA Network

Re14:读论文 ILLSI Interpretable Low-Resource Legal Decision Making

Games101 assignment04 job 04

Using MVC in the UI of unity

Message Passing for Complex Question Answering over Knowledge Graphs

综合设计一个OPPE主页--页面服务部分

零基础利用Unity3D开发AR应用并远程下载3D模型

Binary representation of negative integers and floating point numbers

火了 2 年的服务网格究竟给微服务带来了什么?(转载)
随机推荐
飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用
微信小程序现金红包返回“IP地址非你在商户平台设置的可用IP地址”错误终极解决方法
Egg (19): use egg redis performance optimization to cache data and improve response efficiency
全链路灰度在数据库上我们是怎么做的?
累计出货130亿颗Flash,4亿颗MCU!深度解析兆易创新的三大产品线
[deep learning]: day 9 of pytorch introduction to project practice: dropout implementation (including source code)
Message Passing for Complex Question Answering over Knowledge Graphs
List of supplementary questions
数据库故障容错之系统时钟故障
Cf/atc/lc topic score website
Jsonarray traversal
Ugui learning notes (V) togglegroup makes multiple choice radio boxes
kubenertes 1.16集群部署问题总结
Facet experience -- the development side of dragon game client
Jupyter notebook win installation record
Summary of kubenertes 1.16 cluster deployment problems
[deep learning]: day 5 of pytorch introduction to project practice: realize softmax regression from 0 to 1 (including source code)
Reduce cycle complexity
SUSE Ceph 增加节点、减少节点、 删除OSD磁盘等操作 – Storage6
DGL Chapter 1 (official tutorial) personal notes