Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
create table proc_monitor
(spid int not null,
StartTime datetime not null)
go
create procedure ...
as
insert into proc_monitor
(spid, StartTime)
values
(@@SPID, getdate())
...
delete from proc_monitor
where spid = @@SPID
go
if exists (select * from proc_monitor where StartTime < dateadd(mi, -2, getdate())
exec master.dbo.xp_sendmail 'admin', 'Procedures running to long'