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

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

WBOY
Release: 2016-06-07 17:49:33
Original
1360 people have browsed it

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

--死锁检测

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

--找到SPID

 代码如下 复制代码
exec sp_lock

--根据SPID找到OBJID

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

--根据OBJID找到表名

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template