Показать сообщение отдельно
Старый 12.01.2007, 13:15   #2  
rmv is offline
rmv
Участник
 
481 / 11 (1) +
Регистрация: 15.02.2005
Сброс через час простоя

go
declare
@spid int
DECLARE c CURSOR FOR
select spid from master.dbo.sysprocesses
where program_name='Microsoft Business Solutions-Navision client'
and dateadd(hour, 1, last_batch)<getdate()

open c

fetch next from c into @spid
while @@fetch_status=0 begin
--print @spid
exec ('kill ' + @spid)

fetch next from c into @spid


end
close c
deallocate c


Вообще можно ввести отделы и отделам раздать лимиты на число подключений. Пускай юзеры сами пинают неработающих коллег