Information générale
Forum:
Microsoft SQL Server
I'm trying to kill all connections to a certain database. The following command is successful:
KILL 55
I get an error (Line 12: Incorrect syntax near '@xspid') in the following code on the KILL command. Any ideas?
declare @xspid smallint
declare killspids cursor local for
select spid from master.dbo.sysprocesses where dbid = 7
open killspids
fetch next from killspids into @xspid
WHILE @@FETCH_STATUS = 0
begin
kill @xspid
fetch next from killspids into @xspid
end
deallocate killspids
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement