当前位置:网站首页>Solve the problem of exclusive SQL Server database
Solve the problem of exclusive SQL Server database
2022-07-28 17:21:00 【mojocube】
use master
go
declare @dbname varchar(20)
set @dbname='OA' --- This is the database name
declare @sql nvarchar(500)
declare @spid int--SPID Value is a unique integer assigned to the connection when the user connects
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-- If FETCH The statement does not fail to execute or this line is not in the result set .
begin
exec('kill '[email protected])-- Terminate normal connection
fetch next from getspid into @spid
end
close getspid
deallocate getspid
边栏推荐
- Analysis of kubernetes service principle
- Make full use of English
- Verilog 每日一题 (VL5 信号发生器)
- How to use fail2ban to protect WordPress login page
- The practice of beego framework developed by goweb: Section 4 database configuration and connection
- 软考回顾总结
- Comprehensively design an oppe homepage -- page service part
- Rsync service deployment and parameter details
- Ugui learning notes (III) summary of the use of each control
- Some notes on how unity objects move
猜你喜欢

飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用

Verilog 每日一题 (VL28 加减计数器)

The actual combat of the beego framework of goweb development: Section III program execution process analysis

22年多校第三场(F的证明

HTAP comes at a price

Mysql database addition, deletion, modification and query (detailed explanation of basic operation commands)

: No such file or directory

The practice of beego framework developed by goweb: Section 4 database configuration and connection

Unity editor learning (I) using features to change the display of fields in components

Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021
随机推荐
充分利用----英文
C # traversal set
Unity shader depth of field effect
Some attention code explanations
mysql 最大建议行数2000w,靠谱吗?
2022 Niuke multi school second CDE
Code implementation additive attention
Unity shader texture animation
Reasoning Over Semantic-Level Graph for Fact Checking
In 2020q2, shipments in the global tablet market soared by 26.1%: Huawei ranked third and Lenovo increased the most!
Goweb开发之Beego框架实战:第三节 程序执行流程分析
Janus series article 3 API usage guide videoroom creating a new video room
Atcoder regular contest 133 d.range XOR (digital dp+ classification discussion)
Realize the reset function of steering wheel UI with touch rotation and finger departure in unity
Games101 assignment04 job 04
微服务架构-服务注册中心和服务网关(6.8) (转载)
Shopee code League 2022 - qualification round p3.connecting the numbers (segment tree / bipartite graph determination, to be discussed)
我为什么选择使用Go语言?
Ugui learning notes (IV) ugui event system overview and Usage Summary
Unity shader procedural texture