5 Replies Latest reply on Jul 16, 2013 10:02 AM by Toby Erkson

    How to view underlying SQL queries?

      When I create an Extract or drop a field onto a worksheet, are the SQL queries written to a log file?  If so, exactly where is this log file, what's its name, and how do I identify the query?  I'm guessing it would be an XML file (Tableau seems to like that) with date/time stamps which could be used to zero in on the action.

        • 1. Re: How to view underlying SQL queries?
          Nopparit Intharasombat

          I think the twb file is self-contained.  The SQL query would be under "datasources" XML node.  Tableau does create a child node for each data source even if it comes from the same database instance.  No timestamp though.

           

          SQL query would be the InnerXML of this node "datasources\datasource\connection\relation"

          • 2. Re: How to view underlying SQL queries?
            Joe Mako

            > When I create an Extract or drop a field onto a worksheet, are the SQL queries written to a log file?

            Yes, the log files are located in your "Documents" or "My Documents" folder in your user directory, and in there you should have a "My Tableau Repository" and inside of there is a "Logs" directory with all your log files. My log directory is located at: "C:\Users\joem\Documents\My Tableau Repository\Logs". These are text files that detail every interaction and operation performed in Tableau. If you want to see the SQL that Tableau generates and uses to query your data source, that is contained between lines with the tags <Query> and </Query>

             

            > I think the twb file is self-contained. The SQL query would be under "datasources" XML node.

            The .twb file is basically just a list of settings you have set when creating your workbook. The SQL that you see there is the SQL that defines the connection to your data source, and not the SQL Tableau generates each time you interact or build a view. The SQL in the .twb file is just the starting point for the SQL that Tableau generates.

            • 3. Re: How to view underlying SQL queries?

              Thanks folks!

              • 4. Re: How to view underlying SQL queries?
                Sharon Kundinger

                Nothing is being recorded in  ...\My Tableau Repository\Logs.

                Has this changed for release 8 or is there some sort of configuration setting that will allow us to capture the underlying SQL?

                • 5. Re: How to view underlying SQL queries?
                  Toby Erkson

                  No wonder I didn't recognize the post nor could I give Joe a Correct Answer, this is from two years ago!

                   

                  This still works for me.  Sharon, maybe you didn't install Tableau to the default folders?