返回
顶部

修改密码

移除sql数据所有链接用户

+1

-1

收藏

+1

-1

点赞0

评论0

use master;godeclare @temp nvarchar(20)declare myCurse cursorforselect spidfrom sys.sysprocesseswhere dbid=DB_ID('数据库名称')--待清理的数据库open myCursefetch next from myCurse into @tempwhile @@FETCH_STATUS=0beginexec('kill '+ @temp)fetch next from myC…
use master;
 
go
 
declare @temp nvarchar(20)
 
declare myCurse cursor
 
for
 
select spid
 
from sys.sysprocesses
 
where dbid=DB_ID('数据库名称')--待清理的数据库
 
open myCurse
 
fetch next from myCurse into @temp
 
while @@FETCH_STATUS=0
 
begin
 
exec('kill '+ @temp)
 
fetch next from myCurse into @temp
 
end
 
close myCurse
 
deallocate myCurse;

扫一扫在手机打开

评论
已有0条评论
0/150
提交
热门评论
相关推荐
数据库表连接的简单解释
  • 操作技巧
  • 2022-05-25 18:24
  • 22 0 0
+1
SQL 行转列,列转行
  • 操作技巧
  • 2022-05-25 18:24
  • 20 0 0
+1
一起看懂Redis两种持久化方式的原理
  • 操作技巧
  • 2022-05-25 18:24
  • 32 0 0
+1
为什么要用Redis
  • 操作技巧
  • 2022-05-25 18:24
  • 13 0 0
+1