惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recorded Future
Recorded Future
Microsoft Security Blog
Microsoft Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
B
Blog RSS Feed
小众软件
小众软件
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 聂微东
博客园_首页
B
Blog
雷峰网
雷峰网
S
SegmentFault 最新的问题
N
Netflix TechBlog - Medium
D
Docker
博客园 - 司徒正美
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
U
Unit 42
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
腾讯CDC
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
Jina AI
Jina AI
WordPress大学
WordPress大学
D
DataBreaches.Net
V
V2EX
V
Visual Studio Blog
Know Your Adversary
Know Your Adversary
P
Privacy & Cybersecurity Law Blog
F
Full Disclosure
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
The Hacker News
The Hacker News
Security Archives - TechRepublic
Security Archives - TechRepublic
IT之家
IT之家
P
Privacy International News Feed

博客园 - helloworld22

An excellent mockup tool -- Balsamiq Impression of Team Foundation Server 2010 Impression Of Book – Beautiful Architecture (翻译)十分钟内安装,配置,使用Windows Server AppFabric jQuery插件floatIt,浮动div并居中在上方或者下方 - helloworld22 - 博客园 some useful links for dealing with blg file and performance analyses The time zones of Event log 用证书实现windows 2003下IIS的SSL安全通信 5 Whys Quickly Getting to the Root of a Problem Outlook 2007 Conflicts With Google Desktop Encourage Sentences Collections 标准Singleton设计模式,多线程下 Be careful when you compare the GUID with a string Jmail 64bit 64位 不支持 machineKey - helloworld22 - 博客园 Error Install MS SQL Server Express in Windows XP SP3 / MSXML6 SP2 Sql 2005 Database diagram support objects cannot be installed because this database does not have a valid owner An error occurred during the execution of xp_cmdshell. A call to 'LogonUserW' failed with error code: '1385' Page Load called twice With FireFox - helloworld22
kill all user in a database, very useful
helloworld22 · 2009-12-08 · via 博客园 - helloworld22

It's very useful to tackle a locked database, when you decide to restore it.

Declare   @tblConnectedUsers   Table   (  
  SPID int )  
   
  Declare   @vcSQLText varchar(200),  
  @iSPID int  
   
  --Get   the   currently   connected   users  
  Insert   into     @tblConnectedUsers  
  Select   p.spid  
  from   master.dbo.sysprocesses   p   (nolock)  
  join   master..sysdatabases   d   (nolock)   on   p.dbid   =   d.dbid  
  Where   d.[name]   =   'dbname'   -->   database   name   here  
   
  --Loop   though   the   connected   users   and   kill   their   connections  
  While   1   =   1  
  Begin  
   
  Select   top   1   @iSPID   =   SPID  
  From     @tblConnectedUsers  
  Where   SPID   >   IsNull(@iSPID,   0)    
  order   by   SPID   asc  
   
  --   break   when   there   are   no   more   SPIDs  
  If   @@RowCount   =   0  
  Break  
   
  --Build   the   SQL   string  
  Set   @vcSQLText   =   'Kill   '   +   Convert(varchar(10),   @iSPID)  
   
  Exec(   @vcSQLText   )  
   
  End