Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a42d3bd

Browse files
authored
Update PMDB.Remove database locks.sql
1 parent 344f101 commit a42d3bd

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎PMDB.Remove database locks.sql‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,37 @@ PRINT 'show the blocked processes. '
1919
PRINT '====================================================================='
2020
GO
2121

22-
SELECT DB_NAME(dbid) as 'Database Name', * FROM master.dbo.sysprocesses WITH (NOLOCK)
23-
WHERE BLOCKED <> 0
22+
SELECT
23+
[Database Name] = DB_NAME([dbid])
24+
, *
25+
FROM [master].[dbo].[sysprocesses] WITH(NOLOCK)
26+
WHERE [BLOCKED] != 0;
2427
--DB_NAME(dbid) = 'PMDB_TEST' -- change the database name here
2528

2629
PRINT '====================================================================='
2730
PRINT 'show the blocked process record. '
2831
PRINT '====================================================================='
2932
GO
3033

31-
SELECT DB_NAME(dbid) AS 'Database Name', * FROM master.dbo.sysprocesses
34+
SELECT
35+
[Database Name] = DB_NAME([dbid])
36+
, *
37+
FROM [master].[dbo].[sysprocesses];
3238
WHERE SPID = 212 -- update the spid here
3339

3440
PRINT '====================================================================='
3541
PRINT 'get the sql statement of the blocked process for the ticket. '
3642
PRINT '====================================================================='
3743
GO
3844

39-
DBCC INPUTBUFFER(212) -- update the spid here
45+
DBCC INPUTBUFFER(212); -- update the spid here
4046

4147
PRINT '====================================================================='
4248
PRINT 'remove the blocked process. '
4349
PRINT '====================================================================='
4450
GO
4551

46-
--KILL 212
52+
--KILL 212;
4753

4854
PRINT '====================================================================='
4955
PRINT 'Finished!'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /