1 Reply Latest reply on Aug 1, 2018 8:17 AM by Catherine Brown

    Strange issue with Custom SQL Query

    Paul Newman

      Hi,

       

      I am a beginner to Tableau, but I think this problem is unrelated to that fact!

       

      I have a Custom SQL Query in a Tableau Workbook that is pulling data using a parameter.

      Effectively all it is doing is:

      SELECT * FROM [TABLE] WHERE [FIELD]=[PARAMETER]

       

      It works just fine in most cases, but there are three specific parameter values (out of around thirty) that cause the query to hang forever.

      When I run the same query in SSMS, explicity stating the parameter value, it works fine.

      When I hard code the parameter value in the Custom SQL Query within Tableau, it hangs forever.

       

      There is nothing strange about the specific parameter values, nor the result set that it should return.

      I am stumped. Anyone have any ideas what may cause this?

        • 1. Re: Strange issue with Custom SQL Query
          Catherine Brown

          Hum... there could be issues with the way the table is indexed. Or, if it is coming from a view rather than a table, there could be issues with the query itself.  But, then again you should have the same problem in SSMS. If you have a DBA or someone experienced working with the database you are in, I'd have them look and see if they notice anything odd when you are running the query in Tableau.  If it is a live connection, perhaps change it to an extract, and see what that does?