Find Processes causing Locks on MS SQL DBs
MS SQL provides a Stored Procedure (SP) named sp_who2 which will show up all the actions going on on the MS SQL DB server as shown below: You can have a temporary DB created with data from sp_who2 for your further processing as shown below — check if there is a table already existing with the name — you have choosen for your temp DB, if exists delete it if OBJECT_ID(‘tempdb..#temp_spwho’) > 0 drop table #temp_spwho go — create new table with required fields of sp_who2 create table #temp_spwho ( SPID int not null, Status […]
Read more