var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Sql server 7
pls provide me sql statement that shows all the locks. the goal is to produce the output on an HTML page.
pls help me in solving this
Hi thanks for ur reply,
Main concern is there any way how i can automatically kill the blocked process or there is any stored procedure which will help me killing that session.
kill spid would kill it tnks, i want to know if i can kill it automatically or any stored tht would help me do it.
Thanks once again
Describe the scenario where you would need to kill a spid - normally problems like the one you are trying to solve by killing should be solved by making database design/query changes.
Gotta be careful...you'll wind up with an Orphanage...
If you've got blocking, you need to change your code....
I want to know if we can create a kill command that works automatically, since it could be a different SPID that's locked. Or do you know of a stored procedure that can kill any offending SPID?
You can wrap a cursor around the last sql and execute the kills...
I would think you'd need to kill the blockee and the blocker...
I DONT reccomend this...
CREATE TABLE CurrentBlocks (
, ecid int
, status varchar(255)
, loginame varchar(255)
, hostname varchar(255)
, blk int
, dbname varchar(255)
, cmd varchar(255)
INSERT INTO CurrentBlocks (spid, ecid, status, loginame, hostname, blk, dbname, cmd)
SELECT spid, blk
WHERE blk <> 0