You can use an Office Data Connection (.odc) file to connect to a Microsoft SQL Server database from a Microsoft Office Excel 2007 file. SQL Server is a full-featured, relational database program that is designed for enterprise-wide data solutions that require optimum performance, availability, scalability, and security.
- On the Data tab, in the Get External Data group, click From Other Sources, and then click From SQL Server.
The Data Connection Wizard starts. This wizard has three pages.
Page 1: Connect to Database Server
- In step 1, type the name of the SQL Server computer in the Server name box.
- In step 2, under Log on credentials, do one of the following:
- To use your current Microsoft Windows user name and password, click Use Windows Authentication.
- To enter a database user name and password, click Use the following User Name and Password, and then type your user name and password in the corresponding User Name and Password boxes.
Security Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Passwords should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better. For more information, see Help protect your personal information with strong passwords.It is critical that you remember your password. If you forget your password, Microsoft cannot retrieve it. Store the passwords that you write down in a secure place away from the information that they help protect.
Page 2: Select Database and Table
- Under Select the database that contains the data you want, select a database. Under Connect to a specific table, select a specific table or view.
Alternatively, you can clear the Connect to a specific table check box, so that other users who use this connection file will be prompted for the list of tables and views.
Page 3: Save Data Connection File and Finish
- Optionally, in the File Name box, revise the suggested file name. Click Browse to change the default file location (My Data Sources).
- Optionally, type a description of the file, a friendly name, and common search words in the Description, Friendly Name, and Search Keywords boxes.
- To ensure that the connection file is always used when the data is updated, click the Always attempt to use this file to refresh this data check box. This check box ensures that updates to the connection file will always be used by all workbooks that use that connection file.
- To specify how the external data source of a PivotTable report is accessed if the workbook is saved to Excel Services and is opened by using Excel Services, click Authentication Settings, and then select one of the following options to log on to the data source:
- Windows Authentication Select this option to use the Windows user name and password of the current user. This is the most secure method, but it can affect performance when many users are connected to the server.
- SSO Select this option to use Single Sign On (SSO), and then enter the appropriate identification string in the SSO ID box. A site administrator can configure a Windows SharePoint Services site to use a Single Sign On database in which a user name and password can be stored. This method can be the most efficient when many users are connected to the server.
- None Select this option to save the user name and password in the connection file.
Security Avoid saving logon information when connecting to data sources. This information may be stored as plain text, and a malicious user could access the information to compromise the security of the data source.
Note The authentication setting is used only by Excel Services, and not by Excel.
- Click OK.
- Click Finish to close the Data Connection Wizard.
The Import Data dialog box is displayed.
- Under Select how you want to view this data in your workbook, do one of the following:
- To create an Excel table, click Table (this is the default).
- To create a PivotTable report, click PivotTable Report.
- To create a PivotChart and PivotTable report, click PivotChart and PivotTable Report.
Note The Only Create Connection option is available only for an OLAP database.
- Under Where do you want to put the data?, do one of the following:
- To place the data in an existing worksheet, select Existing worksheet, and then type the name of the first cell in the range of cells where you want to locate the data.
Alternatively, click Collapse Dialog to temporarily collapse the dialog box, select the beginning cell on the worksheet, and then click Expand Dialog .
- To place the data in a new worksheet starting at cell A1, click New worksheet.
- Optionally, you can change the connection properties (and also change the connection file) by clicking Properties, making your changes in the Connection Properties dialog box, and then clicking OK.
For more information, see Connection properties.