January 6, 2022 at 11:19 pm
I work on sql server 2014
How to write query get long process job or query or stored procedure running on server ?
as example suppose i run
exec sp_joblong
how to know this procedure running now
and which place it stop and take long time
and how to know it finish execution on server
January 7, 2022 at 1:24 pm
check out msdb table dbo.sysjobhistory
it logs execution times per step.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
January 7, 2022 at 2:07 pm
I point to three tools for monitoring query performance (not Jobs, Johan's answer is a good one), including batches, statements and procedures. These are, in no particular order, Dynamic Management Views (DMVs), Query Store, and Extended Events. Between the three, you can get what you're looking for. Which query, or queries, are running long. How is the procedure performing. What kind of resources are being used. Do a search for each of these and you'll find tons of good articles & videos on how to use them, including a bunch of good ones right here on SSC.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 8, 2022 at 4:11 pm
Google is your friend here. Pick your poison.
https://www.google.com/search?q=get+list+of+long+running+queries+SQL+Server
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply