Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long Running Query Issue

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
The web application I have built queries a SQL Server 2008 database.

My application runs downstream from the main enterprise app and runs only one query on a frequent basis.
The DBA's informed me one of my queries had been running for four hours and they were killing it.

They later changed the story and said they killed another long running query run by another team, and then my query completed normally.

The query I built usually completes in an instant, so I am wondering if it could have been stuck behind the other query on the same thread , or in some contention with the other query for resources.

My query uses the Nolock hint on all tables it references.

So, excusing my ignorance on how queries actually execute on the server, is it possible my query was stuck behind the other team's query on the same thread?



There has to be a pony in this pile of s*%t somewhere.
 
Yes it sound like table lock use nolock in all not updating query is good idea and it is definitely help if it is locking issue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top