How to to Connect to SQL Server with Microsoft Excel

There is a way to connect to SQL Server with Microsoft Excel. This will be done in a step-by-step format.

Get data

Click Data (1), From Other Sources (2), and then From SQL Server (3).

data from sql server

Connect do data base

Write the Server name that is the same as it is in your domain and hosting supplier (1), choose Use the following User Name and Password (2), write your login information (3), and press next (4).

SQL Server user name password

Select the table or view you want to import into Excel. Choose the worksheet location for the imported data. Click on the Finish button to start the import process.

Alternatively, you can also use the following steps to connect Excel to SQL Server using Microsoft Query:

  1. Open Excel and go to the Data tab in the ribbon.
  2. Click on "From Other Sources" and select "From Microsoft Query".
  3. Choose the data source and click on the Connect button.
  4. Enter the SQL Server name and select the database you want to connect to.
  5. Provide the credentials to connect to the database.
  6. Select the table or view you want to import into Excel.
  7. Choose the worksheet location for the imported data.
  8. Click on the Return Data button to start the import process.

Note: In both methods, you may need to install the Microsoft OLE DB Provider for SQL Server on your computer if it is not already installed. You may also need to configure your firewall to allow Excel to connect to the SQL Server.

Further reading: 
Import external data from text files
Database Functions
How to use SQL in Excel
How to Convert Excel to Web Database?
How to run SQL in Excel VBA