Home >Database >Mysql Tutorial >SQLSERVER被锁的表,以锁表的SQL语句

SQLSERVER被锁的表,以锁表的SQL语句

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:49:331373browse

我们使用mssqlserver数据库经常会碰到锁表,下面我来介绍SQLSERVER被锁的表,以锁表的SQL语句

--死锁检测

 代码如下 复制代码
use master
Select * from sysprocesses where blocked0

--找到SPID

 代码如下 复制代码
exec sp_lock

--根据SPID找到OBJID

 代码如下 复制代码
select object_name(85575343)

--根据OBJID找到表名

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn