﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 Administration  / Adhoc query timing out / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 18:08:59 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Adhoc query timing out</title><link>http://www.sqlservercentral.com/Forums/Topic1410829-1550-1.aspx</link><description>I also sense the difference in settings between SSMS and the Application Server. I will have to check it on the Application Server. But I am not able to understand why the same query is using so many threads when executed using the application and only a single thread when executed through SSMS ?</description><pubDate>Wed, 23 Jan 2013 22:18:58 GMT</pubDate><dc:creator>Abdul Rahman</dc:creator></item><item><title>RE: Adhoc query timing out</title><link>http://www.sqlservercentral.com/Forums/Topic1410829-1550-1.aspx</link><description>The wait types are CXPacket only.I found online that having Arithabort ON could resolve this issue and tried that.I did ran Profiler and yes it is the same query, which we had to kill as it was running forever.[b]It's also an easy way to tell the set statements the connection will force during a connection.[/b]I am not sure on where to check this on the connection ? The query is being generated by the Application and we cannot add any SET commands to it.</description><pubDate>Wed, 23 Jan 2013 17:49:46 GMT</pubDate><dc:creator>Abdul Rahman</dc:creator></item><item><title>RE: Adhoc query timing out</title><link>http://www.sqlservercentral.com/Forums/Topic1410829-1550-1.aspx</link><description>[quote][b]Abdul Rahman (1/23/2013)[/b][hr]HiWe have simple Adhoc queries running from an application.The query runs for hours and gets timed out.At the same time I could see from Activity Monitor that it uses multiple threads.[/quote]That by itself isn't necessarily an issue.  What wait types did you have besides CXPacket?[quote]I even changed the Arithmetic Abort Enabled to True for the database but still its running for hours.[/quote]What did you hope to accomplish with that choice?  Not being rude, we just don't know what you're seeing that you thought it would affect it.[quote]The same query when run in SSMS finishes within 5-10 mintues and also uses only one thread.[/quote]This is telling.  First, I'd check on all the settings that the connection is using vs. the ones you default to for SSMS.  Connections also default setings, like SET ANSI_NULL on, things like that.  This may help you locate part of your issue.Secondly, I'd confirm that it's the EXACT same query by using profiler and trapping the query on its way in from the application.  Very minor differences can make a huge difference.  It's also an easy way to tell the set statements the connection will force during a connection.</description><pubDate>Wed, 23 Jan 2013 17:21:25 GMT</pubDate><dc:creator>Evil Kraig F</dc:creator></item><item><title>Adhoc query timing out</title><link>http://www.sqlservercentral.com/Forums/Topic1410829-1550-1.aspx</link><description>HiWe have simple Adhoc queries running from an application.The query runs for hours and gets timed out.At the same time I could see from Activity Monitor that it uses multiple threads.I even changed the Arithmetic Abort Enabled to True for the database but still its running for hours.The same query when run in SSMS finishes within 5-10 mintues and also uses only one thread.I am pretty confused on fixing this behaviour. Any insight would be helpful.Thanks.</description><pubDate>Wed, 23 Jan 2013 15:57:36 GMT</pubDate><dc:creator>Abdul Rahman</dc:creator></item></channel></rss>