Microsoft Excel How To: Query a Microsoft SQL Server Database in Excel with a SQL Query
Microsoft Excel How To: Query a Microsoft SQL Server Database in Excel with a SQL Query
1) Click on the Data tab
2) Click on From Other Sources
3) Click on From SQL Server
4) Enter Server Name and Log on Credentials.
5) Select the Database and Table (Even if you are using a query, select a table just the same).
6) Enter ‘FileName’.
7) Enter ‘Description’
8) Select Only Create Connection.
9) In Data Tab click on Existing Connections.
10) Select Connection.
11) Click on Connection Properties.
12) Click on Definition.
13) Click on command type: SQL
14) Enter the SQL query.
15) Click on Table if you want to insert the table in the Excel Sheet.
16) The data will be displayed in the Spreadsheet.