title: SSRS Report timing out after 10 minutes
body: <p>I have a report with an incredibly slow dataset. Unfortunately we can't optimise the query further at this moment in time. However, no matter what timeouts i change the report still times out after 10 minutes. I have tried the report dataset timeout, the report execution time out as well as the remote execution on the sql server. None seem to have worked.</p>
  
  <p>a bit of digging yielded the following resource which i have also tried to no avail:</p>
  
  <p><a href="https://blogs.msdn.microsoft.com/selvar/2010/07/12/report-builder-2-0-3-0-errors-out-with-the-operation-has-timed-out-when-previewing-a-report-saved-in-report-server-takes-more-than-10-minutes/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/selvar/2010/07/12/report-builder-2-0-3-0-errors-out-with-the-operation-has-timed-out-when-previewing-a-report-saved-in-report-server-takes-more-than-10-minutes/</a></p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/ms155782.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ms155782.aspx</a></p>
  
  <p>Why would my report be timing out after 10 minutes?</p>
  
  <p>The script:</p>
  
  <pre><code>DECLARE @SessionDateFrom DATETIME = '2016/11/01'
  DECLARE @SessionDateTo DATETIME = '2016/12/01'
  DECLARE @SiteNo INT = 1
  
  SELECT DISTINCT [CS].[No] AS SiteNo
      ,[CS].[Name] AS SiteName
      ,TSE.[MediaNo] AS Media
      ,TSE.[MediaIndex]
      ,Sum(TSE.[Qty]) AS SalesQty
      ,Sum(TSE.[Value]) AS SalesValue
      ,TSE.[MediaGroup]
      ,TSE.[MediaName]
      ,TSE.SortOrder
      ,TSE.[ReasonNo]
      ,[R].[Name] AS ReasonName
      ,Convert(BIT, CASE 
              WHEN TSE.[MediaNo] NOT IN (
                      1001
                      ,1002
                      ,1003
                      ,1004
                      ,3002
                      ,3004
                      ,7002
                      ,7004
                      ,7006
                      )
                  THEN 1
              ELSE 0
              END) AS Clickable
  FROM TSE
  LEFT JOIN CS ON CS.No = TSE.SiteNo
  LEFT JOIN R ON (R.No = TSE.ReasonNo)
  WHERE EXISTS (
              SELECT Descendant
              FROM DescendantSites
              WHERE Parent = @SiteNo
                  AND Descendant = TSE.SiteNo
              )
          AND (
              Qty &lt;&gt; 0
              OR Value &lt;&gt; 0
              )
          AND MediaNo &lt;&gt; 0
          AND ExcludeFromReport &lt;&gt; 1
          --AND (
          --  MediaNo IN (@MediaNo)
          --  OR MediaNo IS NULL
          --  )
          AND TermNo = 0
          AND SessionDate BETWEEN @SessionDateFrom
              AND @SessionDateTo
  GROUP BY [CS].[No]
      ,[CS].[Name]
      ,TSE.[MediaNo]
      ,TSE.[MediaIndex]
      ,TSE.[MediaGroup]
      ,TSE.[MediaName]
      ,TSE.SortOrder
      ,TSE.[ReasonNo]
      ,[Reason].[Name]
  ORDER BY TSE.[MediaGroup]
      ,TSE.[SortOrder]
      ,TSE.[MediaIndex]
  OPTION (OPTIMIZE FOR UNKNOWN)
  </code></pre>
  
  <p>Will need to filter for media but the if it can return all in reasonable time then should be okay (please correct me if that logic is wrong. Im quite new to sql).</p>