Detach
Ola pessoal.
Como faço para derrubar usuarios via comando no sql server 2000?
Obrigado!
Ricardo Gavira
DigithoBrasil
Como faço para derrubar usuarios via comando no sql server 2000?
Obrigado!
Ricardo Gavira
DigithoBrasil
By_gandalf
Curtidas 0
Respostas
Marcus.magalhaes
25/05/2005
Bom dia.
Utilize o comando kill
Ex.:
Declare @var_spid Int,
@var_command VarChar(255)
Declare cur_CONEXAO Cursor For Select spid From master..sysprocesses (NoLock) Where spid <> @@spid
Open cur_CONEXAO
Fetch Next From cur_CONEXAO Into @var_spid
While (@@fetch_status = 0)
Begin
Set @var_command = ´kill ´ + Convert(VarChar, @var_spid)
Exec (@var_command)
Fetch Next From cur_CONEXAO Into @var_spid
End
Close cur_CONEXAO
Deallocate cur_CONEXAO
GO
Utilize o comando kill
Ex.:
Declare @var_spid Int,
@var_command VarChar(255)
Declare cur_CONEXAO Cursor For Select spid From master..sysprocesses (NoLock) Where spid <> @@spid
Open cur_CONEXAO
Fetch Next From cur_CONEXAO Into @var_spid
While (@@fetch_status = 0)
Begin
Set @var_command = ´kill ´ + Convert(VarChar, @var_spid)
Exec (@var_command)
Fetch Next From cur_CONEXAO Into @var_spid
End
Close cur_CONEXAO
Deallocate cur_CONEXAO
GO
GOSTEI 0