ASAP...thanksUse the below command:-
KILL SPID
SPID you can get from master..sysprocesses table
Thanks
Hari
SQL Server MVP
"Jamie Elliott" <JamieElliott@.discussions.microsoft.com> wrote in message
news:361BFBE0-E309-430E-8B34-E8D96B906AD2@.microsoft.com...
>I need a script to kill several process ids by a certain host....need help
> ASAP...thanks|||There are about 100 dead process ids from 1 host, are you saying this will
kill all the process ids from this single host?
"Hari Pra

> Use the below command:-
> KILL SPID
> SPID you can get from master..sysprocesses table
> Thanks
> Hari
> SQL Server MVP
>
> "Jamie Elliott" <JamieElliott@.discussions.microsoft.com> wrote in message
> news:361BFBE0-E309-430E-8B34-E8D96B906AD2@.microsoft.com...
>
>|||Declare @.Host VarChar(100)
Set @.Host = '<Put Computer HostName Here>'
Declare @.Sql VarChar(20)
While Exists
(Select * From master..SysProcesses
Where HostName = @.Host)
Begin
Select @.Sql = 'Kill ' +
LTrim*Str(Max(Spid), 5,0))
From master..sysProcesses
Where HostName = @.Host
-- --
Exec(@.Sql)
End
"Jamie Elliott" wrote:
> There are about 100 dead process ids from 1 host, are you saying this will
> kill all the process ids from this single host?
> "Hari Pra

>
No comments:
Post a Comment