QBoard » Advanced Visualizations » Viz - Tableau » How to see Tableau Custom SQL on server without downloading workbook?

How to see Tableau Custom SQL on server without downloading workbook?

  • Oftentimes I need to troubleshoot a workbook that another person at my company has created and published to our server. To troubleshoot, I need to see their connection details, specifically their Custom SQL, to understand what data they are using in their extract.
    Is there any way to view this connection info (specifically their SQL code) when viewing the published workbook on the server (web) version?
    I am an admin and I am able to download their workbook to my desktop version of tableau, then open it, then reconnect to the data, then look through the data connections they created, to see their SQL. But it's a really cumbersome process.
    All I'm looking to do is, when looking at a published workbook, see the data connection details so that I can see the Custom SQL, without going through the process of downloading I described above.
      September 21, 2021 7:01 PM IST
    0
  • You can get some details on the SQL statement by creating a performance recording.

    From the Tableau Server Admin Guide:

    Enable Performance Recordings:

    1. Choose the Admin button in Tableau Server.
    2. Choose Site.
    3. Select a site.
    4. Choose Edit.
    5. In the Edit Site dialog box, select Allow Performance Recording.
    6. Choose OK.

    You start performance recording for a specific view by adding ?:record_performance=yes to the url. For example: http://server.site.com/views/Variety/BaseballStatistics?:record_performance=yes

    Now, notice a new link at the top of your view called "Show Performance Recording". Click this to open the generated performance workbook dashboard. Click on the bar chart and observe the SQL appear at the bottom of the view. Note, the SQL text will truncate after about 250 characters.

    The admin guide suggests viewing the "Tableau Log" to find the full SQL statement.. I have looked at all the server side logs in C:\ProgramData\Tableau\Tableau Server\data\tabsvc\logs but cannot locate the SQL. (please reply if you know where to find this?)

    You can also run a database trace to see the SQL that the database sees. For example, for MS SQL Server, run the Profiler tool, setup a default trace, and filter on "Application Name" = "Tableau Protocol Server 8.0" or similar.

      September 29, 2021 1:50 PM IST
    0
  • I thought you could do this easily, and originally answered that you could, but I didn't pay close attention to your question. You can change some things about data connections without editing the workbook, including the ip address or name of the database server, but there doesn't appear to be a simple way to access custom sql without downloading the workbook.

    Go to the Administrator page and select Data Connections. You can enter some search criteria to filter the list of data connections shown (or not). Find the workbook in question by scanning the second column -- you can sort the column if that helps. Then select the corresponding data connection in the 4th column to see the details of the connection.

    If it makes sense for the connection, you can also modify the connection directly at the server. This is really useful if you, say, need to move your enterprise database to a new IP address or change a database password, without downloading, modifying and republishing alot of workbooks.

    An even better practice is to start using shared data connections hosted on Tableau server instead of having each workbook have its own local copy of connection and related info.

      October 1, 2021 1:25 PM IST
    0
  • I have version 8.1 and this is how I got around this problem. Tableau shows a 'Custom SQL Warning' when you open a workbook that contains the custom SQL. You can copy all the text in this message by simply ctrl + c as this is any other Windows warning message. And then paste it your editor of choice to analyze it.

    I do not know if this works on earlier versions.

      October 5, 2021 1:00 PM IST
    0
    • Some of the details are available on the SQL statement by creating a performance recording.

    • From the Tableau Server Admin Guide:

    • Enable Performance Recordings:

    1. Choose the Admin button in Tableau Server.

    2. Choose Site.

    3. Select a site.

    4. Choose Edit.

    5. select Allow Performance Recording in the Edit Site dialog box

    6. Choose OK.

     

    • You have to start performance recording for a specific view by adding ?:record_performance=yes to the URL. For example http://server.site.com/views/Variety/BaseballStatistics?:record_performance=yes

    • Now, you can notice a new link at the top of your view called "Show Performance Recording".Now, click this to open the generated performance workbook dashboard. And then click on the bar chart and observe the SQL appear at the bottom of the view. You have to make a note that the SQL text will truncate after about 250 characters.

    • Basically, admin guide suggests viewing the "Tableau Log" to find the full SQL statement.. I have looked at all the server-side logs in C:\ProgramData\Tableau\Tableau Server\data\tabsvc\logs but cannot locate the SQL. 

    • You can also be able to run a database trace to see the SQL that the database sees. Let see an example, for MS SQL Server, run the Profiler tool, set up a default trace, and filter on "Application Name" = "Tableau Protocol Server 8.0" or similar.

      October 8, 2021 12:58 PM IST
    0