gdufo

 

杀掉SQLServer某些链接进程


select * from sysprocesses
where dbid in (select dbid from sysdatabases where name='overtime')
and program_name ='PHP 5'


USE master
DECLARE @spid int
DECLARE CUR CURSOR
FOR SELECT spid FROM sysprocesses WHERE dbid = 11 and program_name ='PHP 5'
OPEN CUR
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

posted on 2013-10-29 08:11 gdufo 阅读(592) 评论(0)  编辑  收藏 所属分类: Database (oracle, sqlser,MYSQL)


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿(6)

随笔分类

随笔档案

文章分类

文章档案

收藏夹

Hibernate

友情链接

搜索

最新评论

阅读排行榜

评论排行榜