Connections
select DATEDIFF(minute, p.login_time,getDate() ),
'Kill ' + str(p.spid) as Killl ,
p.hostname,
p.program_name,
p.login_time,
p.last_batch
from master..sysprocesses p, master..sysdatabases d
where d.name = DB_NAME()
and d.dbid = p.dbid
AND p.status = 'sleeping'
and DATEDIFF(minute, p.login_time,getDate() ) > 1
order by DATEDIFF(minute, p.login_time,getDate() ) desc