romaklimenko
8/19/2015 - 12:40 PM

sp_lock with human face

sp_lock with human face

SET NOCOUNT ON

DECLARE @sp_lock TABLE(
	[spid] INT,
	[dbid] INT,
	[ObjId] INT,
	[IndId] INT,
	[Type] NCHAR(4),
	[Resource] NVARCHAR(MAX),
	[Mode] NVARCHAR(MAX),
	[Status] NVARCHAR(MAX))
INSERT INTO @sp_lock EXEC sp_lock
SELECT
	lock.[spid],
	lock.[dbid],
	DB_NAME(lock.[dbid]) AS [db_name],
	lock.[ObjId],
	OBJECT_NAME(lock.[ObjId]),
	lock.[Type],
	lock.[Resource],
	lock.[Mode],
	lock.[Status]
FROM @sp_lock as lock
WHERE DB_NAME(lock.[dbid]) = 'Sitecore_Master'