4 Replies Latest reply on Apr 10, 2017 12:49 AM by Glen Robinson

    Database Name

    Puneet Neotia

      IS there a way to get the database name or the entire database connection string from a function in Viz. Either by Pass Through Query or otherwise. I want to be able to display the database name automatically and the environment? If so, please share some examples.

        • 1. Re: Database Name

          There isn't a function that gets the server name.  In Custom SQL, it doesn't allow either.  So it would have to be connected to a stored procedure or function.


          Your stored procedure would be really simple:

          where you'd write your select statement, just write


          "Select @@servername".

          • 2. Re: Database Name
            Glen Robinson

            Hi Puneet

            in the Sheet title you are able to display the 'Data Connection Name'. If this is 'nicely' named, you could use this to identify the DB...



            Screen Shot 2017-04-07 at 16.18.13.png

            2 of 2 people found this helpful
            • 3. Re: Database Name

              Hi Glen, what version of Tableau are you using?  I don't have "Data Connection Name" and am using Tableau 10.1.  That would be handy if I have it.




              • 4. Re: Database Name
                Glen Robinson

                Hi Sea

                I have just checked, and it has been available since (at least) 9.0

                This information is only available (AFAIK) when editing the sheet title. Cant see it anywhere else

                All the best



                Updated: Just re-checked.

                In 9.x it looks that there is the option to show Data Connection Name, but in 10.x it is Data Source Name...