How to Access SQL From Microsoft Office

by James Highland

The Structured Query Language (SQL) is used to manipulate databases. Extracting information from a database, sorting it, running analytical calculations and inserting new data are all tasks accomplished by SQL. This common language is used on many database platforms designed by different companies. Microsoft Office offers some SQL abilities. You can design SQL queries directly within its database application, Microsoft Access, or access SQL systems from within Microsoft Excel. While Microsoft Office itself is not a robust database platform, these tools are in place to extend the reach of its product suite.

SQL View in Microsoft Access

1

Open Microsoft Access from the "Start" menu's "All Programs" folder in the Microsoft Office sub-menu. This program is included in many installations of the Microsoft Office product suite.

2

Click on the "Queries" pane in the main Microsoft Access control panel. This is the second option in the command list along the left of any database window.

3

Open an existing query by clicking any listed in the "Queries" pane, or click the "Create New Query" button. A new window will open in the query view.

4

Click the "View" menu at the top of the Access window.

5

Select the "SQL View" option in the menu. A new window will appear. You are now able to manipulate the database using standard SQL statements.

Connect to SQL from Excel

1

Open Microsoft Excel from the "Start" menu's "All Programs" folder in the Microsoft Office sub-menu.

2

Click the "Data" tab at the top of the program. Click the "Microsoft Query" option in the "From other sources" menu.

3

Click the "Use the Query Wizard to create/edit queries" check box in the window that appears.

4

Locate any external database source in the window that you wish to connect with Excel. This can be a Microsoft Access database or an SQL server. Click "OK." The Query Wizard will launch.

5

Type SQL statements to customize the data import. You have now accessed an SQL interface to control how Excel extracts data from outside sources.

Items you will need

About the Author

James Highland started writing professionally in 1998. He has written for the New York Institute of Finance and Chron.com. He has an extensive background in financial investing and has taught computer programming courses for two New York companies. He has a Bachelor of Arts in film production from Indiana University.

Photo Credits

  • photo_camera database on paper image by .shock from Fotolia.com