Connecting to a SQL Server

Although it is pretty easy to connect to Access, Excel, and other flat files, data is frequently stored on some sort of relational database on a server, such as on the SQL Server or Oracle. Tableau offers connections to various data stores too. Here, we'll focus on Microsoft SQL Server.

Getting ready

Security roles, server connections, authentication issues, port and firewall details, and other factors can create problems while trying to access data from a server. The solutions to these problems are out of the scope of this book but you should make sure that you are able to access the server database from the same computer on which Tableau is installed.

How to do it...

Once you have made sure you have access to the database server and the database, perform the following steps to connect to a Microsoft SQL Server table:

  1. From Tableau's main screen, click on Connect to Data.
  2. Under the On a server option, click on Microsoft SQL Server.
  3. In the Microsoft SQL Server Connection dialog box, enter the server name as shown in the following screenshot.
  4. Click on the Connect button under the Establish the connection option.
    How to do it...
  5. Select AdventureWorks2012 as a database on the server.
  6. Under Define the connection, select Single Table and then Person (Person.Person), as shown in the following screenshot:
    How to do it...
  7. Hit OK.
  8. Select the Connect Live option to connect to the SQL Server database directly.

How it works...

Using the the Connect Live option in Tableau, we connected to a SQL Server database directly. This option allows users to create visualizations that will be refreshed as the underlying data changes. If connected live, Tableau will create results based on the SQL Server's settings, which are usually set to maximize performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset