Lock and Connection Management

Technical Article

sp_what

  • Script

This is a replacement for SP_who and modification of sp_who2. It will always list only active, nonsystem processes, and will list the number of seconds a transaction has been running for. Some transactions do not report a last batch time, so I forced a large value to display so you can see any issue with […]

5 (1)

2006-10-02 (first published: )

2,153 reads

Technical Article

To Identify blocks if using Solomon IV

  • Script

Our business accounting software is Microsoft Business Solutions Solomon IV.which is now being called Dynamics Solomon. You will see specific refernces to this software in this code. I originally developed this to gain faster view of issues we were having with Solomon. This procedure analyzes system tables and looks for blocks. This isfaster than using […]

2005-11-03 (first published: )

398 reads

Technical Article

Save results DBCC SQLPERF(UMSSTATS) in a table

  • Script

Examining the output of DBCC SQLPERF(UMSSTATS) helps in determining a CPU bottleneck. The output of the command is not handy for further investigation (from a table).This procedure performs a transformation of the results, so it is easy to query and store in a database.

2005-11-04 (first published: )

1,926 reads

Technical Article

Blocked Process script for deadlock correction

  • Script

This script was created to find an application problem that was causing SQL Server blocked processes. The BlockedProcess table is created to log both the blocker and blocked processes. The sp_BlockedProcess stored procedure is created to handle the situation by: inserting all processes affected by the blocking, notifying the blocking application user, emailing the admins […]

5 (2)

2005-12-01 (first published: )

4,144 reads

Technical Article

Kill all SPIDs with a certain user ID

  • Script

This script is used to disconnect all connections by a particular individual to a server. I use it when I have to disconnect somebody and they have too many processes to do it by hand. Normally, you can just connect the offending process, but if there are multiple processes that are causing a problem , […]

2004-03-08

1,678 reads

Technical Article

blocked  and blocker  spid and details

  • Script

2 steps:step 1 => create   a table in master database called BlockCheckstep 2 =>  create the stored procedure in master  called  BLOCK_CHECK @database_name varchar(20)What SP  does:-    it gets the  spid that is blocked  + info about it (like what it does  at the moment  it is blocked)-    it gets the spid  that  acts as a […]

4 (1)

2003-06-05

713 reads

Technical Article

Script to kill the top blocker and report what it was doing.

  • Script

This script identifies the blocking locks at the top of the blocking chain and kills them. Specifically, it reports what the top blocking spids are doing, kills them, waits three seconds and then reports on current blocking status.  If you have a situation where single connections are causing a huge blocking chain and you want […]

4.75 (4)

2003-05-12

2,960 reads

Blogs

Daily Coping 4 Jul 2022

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

SQLServerCarpenter Tools

By

Over the past couple of years, I’ve developed several tools that I’ve been using...

usp_SQLServerCarpenter_Tools_Get_Procedures_Triggers_Missing_SET_NOCOUNT_ON

By

/* Author:Brahmanand Shukla (SQLServerCarpenter.com) Date:27-May-2022 Purpose:To get all the stored procedures and triggers missing the use of...

Read the latest Blogs

Forums

CAST AS DATE Assistance

By carlton 84646

Can someone let me know why I'm not able to use CAST method to...

Deploying a standalone Azure VM running SQL Server into an availability zone

By DBANewbie

If i deploy a standalone Azure VM running SQL Server into an availavility zone;...

SQL Server 2014 Question

By kazana

So I have inherited an older SQL 2014 Server and have been working on...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers