Connect to a SQL Server database

  1. In the POWER QUERY ribbon tab, click From Database > From SQL Server Database.
  2. In the Microsoft SQL Database dialog box, specify the SQL Server to connect to in the Server Name box. Optionally, you can specify a Database Name as well.
  3. If you want to import data using a native database query, specify your query in the SQL Statement box. For more information, see Import Data from Database using Native Database Query.
  4. Click OK.
  5. Select the authentication mode to connect to the SQL Server database.
  1. Windows: This is the default selection. Select this if you want to connect using Windows authentication.
  2. Database: Select this if you want to connect using SQL Server authentication. After you select this, specify a user name and password to connect to your SQL Server instance.
  1. By default, the Encrypt connection check box is selected to signify that Power Query connects to your database using an encrypted connection. If you do not want to connect using an encrypted connection, clear this check box, and then click Save.

If a connection to your SQL Server is not established using an encrypted connection, Power Query prompts you to connect using an unencrypted connection. Click OK in the message to connect using an unencrypted connection.

Formula Example

= Sql.Databases(".")
= Sql.Database(".","AdventureWorks2012")

Related Topics

Import data from external data sources

 
 
Applies to:
Excel 2013, Excel 2010