Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Queries hang on some databases Expand / Collapse
Posted Monday, January 6, 2014 4:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, January 11, 2014 1:25 AM
Points: 2, Visits: 6
I am using C# and Telerik reports. For client my report hang up for some table and shows Network error while this query runs correctly in T-SQL and fetch data in milliseconds. After running query in T-Sql , report also runs correctly and application fetch data. Previously this issue occur and i deattach and reattach client database and that solve my problem but now it does not work.
Can anyone tell me what can be the cause and how this problem may be solved.
Post #1528036
Posted Monday, January 6, 2014 5:16 AM



Group: General Forum Members
Last Login: Saturday, December 3, 2016 9:18 AM
Points: 2,983, Visits: 3,573
Take a look in the Activity Monitor in SSMS on the SQL Server at the moment the clients query seems to hang. Look at all the processes/queries that are executed against the database and look for the wait resources and/or blocking processes.
Detaching and attaching the database should not be the solution. When this work-around solves your problem it is probably because your query is being blocked. Detaching and attaching the database effectively kills all connections to the database, after which your query can be started again. You should however investigate which other process is blocking your query en subsequently investigate why that other process keeps on running or is running too long or runs at that particular moment.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Post #1528049
Posted Monday, January 6, 2014 5:18 AM



Group: General Forum Members
Last Login: Today @ 10:23 AM
Points: 17,173, Visits: 32,135
All you did by detaching the database was flush queries out of the cache (and probably flushed data out of the cache too). That's not a solution. Instead, you need to set up monitoring on your server in order to understand where the bottlenecks are coming from. Then, usually, you have to look at the code of the queries to see what's going wrong. All these topics are covered in the books in my signature below. With such a generic question, that's all the information I can suggest.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1528050
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse