SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Queries hang on some databases


Queries hang on some databases

Author
Message
Saima Khan
Saima Khan
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 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.
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 8984 Visits: 3718
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’! **
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)

Group: General Forum Members
Points: 101695 Visits: 33014
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 and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search