a few days ago, I was working on a very simple ETL task . What I did is delete a table
and reinsert. However, odd things happen after deletion as it takes forever to count the number
in this table... very odd
After while, I figured it out by using the script below to find out which process is blocking the table
and kill the process. After that,everything is back to normal
-- find out which process is blocking
select distinct object_name(a.rsc_objid), a.req_spid, b.loginame
from master.dbo.syslockinfo a (nolock) join
master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid
where object_name(a.rsc_objid) is not null
Friday, April 1, 2016
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment