2006-11-07

SQL Server死锁的分析

来源: 21世纪安全 作者:佚名 评论 0 条
 )

  请参考sqlservercentral.com上更具体的讲解.但又从CSDN学到了一个找到死锁原因的方法。我稍加修改, 去掉了游标操作并增加了一些提示信息,写了一个系统存储过程sp_who_lock.sql。代码如下:

Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_who_lock]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sp_who_lock] GO /******************************************************** // 创建 : fengyu 邮件 : maggiefengyu@tom.com // 日期 :2004-04-30 // 修改 : 从http://www.csdn.net/develop/Read_Article.asp?id=26566 // 学习到并改写 // 说明 : 查看数据库里阻塞和死锁情况 ********************************************************/ use master go create procedure sp_who_lock as begin declare @spid int,@bl int, @intTransactionCountOnEntry int, @intRowcount int, @intCountProperties int, @intCounter int create table #tmp_lock_who ( id int identity(1,1), spid smallint, bl smallint) IF @@ERROR<>0
共5页: 上一页 [1] 2 [3] [4] [5] 下一页
(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:加快SQL Server备份和重新存储的速度  
下一篇:Sql server进行优化50招特效
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号