Hi,
I am trying to figure out a way to Kill a process through SQL Query Analyzer so my user doesn't have to get in and play around with Enterprise Manager.
Does anyone have a suggestion?
I was going to build an @temp table to insert the sp_who2 info so I could order or filter the results:
Then I was going to see if she could KILL based on the spid.
When trying this script I get an error Incorrect syntax near 'sp_who2'. If I change it to
INSERT INTO @Temp Exec sp_who2 - I get an error: EXECUTE cannot be used as a source when inserting into a table variable.
Does anyone have a suggestion how I can kill the process or insert the sp_who2 info into a temp table?
Using SQL 2000.
Thanks!
Brian
I am trying to figure out a way to Kill a process through SQL Query Analyzer so my user doesn't have to get in and play around with Enterprise Manager.
Does anyone have a suggestion?
I was going to build an @temp table to insert the sp_who2 info so I could order or filter the results:
Code:
dECLARE @Temp TABLE (
spid smallint,
ecid smallint,
status nchar(30),
loginname nchar(128),
hostname nchar(128),
blk char(5),
dbname nchar(128),
cmd nchar(16),
request_id INT
)
INSERT INTO @Temp sp_who2
SELECT * FROM @Temp WHERE dbname = 'kootbatch1a'
Then I was going to see if she could KILL based on the spid.
When trying this script I get an error Incorrect syntax near 'sp_who2'. If I change it to
INSERT INTO @Temp Exec sp_who2 - I get an error: EXECUTE cannot be used as a source when inserting into a table variable.
Does anyone have a suggestion how I can kill the process or insert the sp_who2 info into a temp table?
Using SQL 2000.
Thanks!
Brian