How to check blocking queries in SQL Server
I have one warehouse server which got data/sync from legacy system 24/7, I noticed some of my reports/sql jobs performance is uncertain and most of the time I heard from DBA team that my query is blocking to other sync process. From DBA team I came to know command i.e. EXEC SP_WHO2 by which I can identify spid of query which cause blocking by looking into column BlkBy. Please suggest me how I can avoid blocking and other ways to check blocking in SQL Server Apart from Sp_Who2 you can use following query to identify blocking in you SQL. SELECT db.name DBName, tl.request_session_id, wt.blocking