Sqlinsertinto... select... deadlock Solution
SQL insert into... select... deadlock Solution
SQL insert into... select... deadlock Solution
Method 1
Insert into a select * from B with (xlock) where form_no = @ form_no
Method 2,
Sp_who -- sql2000 and above
Dbcc inputbuffer (spid) -- used to view specific statements
Kill spid -- kill the process.
-- Or
Select * from sys. sysprocesses -- sql2005 and later
A. Top Five queries by average cpu time
This solution provides information about the cpu time, io read/write, and the number of executions of the first five queries based on the average cpu time.
Select top 5
Total_worker_time/execution_count as [avg cpu time],
(Select substring (text, statement_start_offset/2, (case when statement_end_offset =-1 then len (convert (nvarchar (max), text) * 2 else statement_end_offset end-statement_start_offset) /2) from sys. dm_exec_ SQL _text (SQL _handle) as query_text
From sys. dm_exec_query_stats
Order by [avg cpu time] desc