1 Reply Latest reply on Mar 16, 2017 5:50 AM by lenaic.ridinger

    Custom SQL Connection to SQL Server

    Nicholas Church

      Hello Tableau Gurus,


      This may well be a SQL Server question to be honest, but I'd be interested to know if anyone else has tried setting this up!


      Reporting Requirement:

      Firstly - a quick background of what we are trying to achieve. We want to provide functionality through tableau that allows users to produce lists of contact information that they can filter on. These filters can include requirements such as using not in (also, filtering options might work on different sets of data which operate at different levels but we're ultimately only interested in the contact details), a SQL example of what we are trying to do might be:


      select *

      from CONTACT

      where CONTACT_COMPANY_ID in (select COMPANY_ID

                                                                     from COMPANY

                                                                   where BRAND = 'BRAND_A'

                                                                      and COMPANY_ID not in (select COMPANY_ID

                                                                                                                   from COMPANY

                                                                                                                 where BRAND = 'BRAND_B'))



      From what I've tried with Tableau, I'm not sure its going to be easy to do something like the above. In that example SQL, I guess potentially could create the Cartesian product of contact joined to company twice, and then I'd be able to filter as required, but I'm going to end up creating a huge data set in that way!


      Custom SQL Connection:

      So at this point I'm looking to create a user with read access to a SQL Server database, which I can share with our user community and then our users (who are SQL savvy and would like access to the DB!)  should be able to use tableau desktop to tweak the connection as per their specific requirement. However, I don't want them to have access to the DB through any other means - i.e. management studio.


      I've spoken with our DBA's who have suggested that restricting access is possible, however they believe I'd have to force the application (I.e. Tableau) to go through a stored procedure which would then validate access dependent on how the user logs in (I'm assuming it would only allow access to that user if it is via that stored proc but I'm not sure on the details).


      The Question

      So in a rather long winded explanation, the question is really has anyone created their user community a read only SQL Server account that can be used to connect to a SQL Server database via Tableau, but only from Tableau?