Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.
Import or link to data in an SQL Server database

You can link to or import data from an SQL Database, which is a high-performing managed database used for mission-critical applications. For more information, see SQL Server 2016.

  • When you link to data, Access creates a two-way connection that synchronizes changes to data in Access and the SQL Database.

  • When you import data, Access creates a one-time, copy of the data, and so changes to data in either Access or the SQL Database are not synchronized.

Overview of connecting Access to SQL Server

Before you begin

Want things to go smoother? Then make the following preparations before you link or import:

  • Locate the SQL Server database server name, identify necessary connection information, and choose an authentication method (Windows or SQL Server). For more information on the methods of authentication, see Connect to Server (Database Engine) and Securing your database.

  • Identify the tables or views that you want to link to or import, and uniquely-valued fields for linked tables. You can link to or import more than one table or view in a single operation.

  • Consider the number of columns in each table or view. Access does not support more than 255 fields in a table, so Access links or imports only the first 255 columns. As a workaround, you can create a view in the SQL Server Database to access the columns beyond the limit.

  • Determine the total amount of data being imported. The maximum size of an Access database is two gigabytes, minus the space needed for system objects. If the SQL Server database contains large tables, you might not be able to import them all into a single Access database. In this case, consider linking to the data instead of importing.

  • Secure your Access database and the connection information it contains by using a trusted location and an Access database password. This is especially important if you choose to save the SQL Server password in Access.

  • Plan for making additional relationships. Access does not automatically create relationships between related tables at the end of an import operation. You can manually create the relationships between new and existing tables by using the Relationships window. For more information, see What is the Relationships window? and Create, edit or delete a relationship.

Stage 1: Get started

  1. Select External Data > New Data Source > From Database > From SQL Server.

  2. In the Get External Data – ODBC Database dialog box, do one of the following:

    • To import data, select Import the source data into a new table in the current database.

    • To link to data, select Link the data source by creating a linked table.

  3. Select OK.

Stage 2: Create or reuse a DSN file

You can create a DSN file or reuse an existing one. Use a DSN file when you want to rely on the same connection information for different link and import operations or to share with a different application that also uses DSN files. You can create a DSN file directly by using the Data Connection Manager. For more information, see Administer ODBC data sources.

Although you can still use prior versions of the SQL ODBC driver, we recommend using version 13.1, which has many improvements, and supports new SQL Server 2016 features. For more information, see Microsoft ODBC Driver for SQL Server on Windows.

  1. Do one of the following:

    • If the DSN file you want to use already exists, select it from the list.

      Select Data Source dialog box

      Depending on which authentication method you entered in the connection information, you may need to enter a password again.

    • To create a new DSN file:

      1. Select New.

        Create New Data Source dialog box
      2. Select ODBC Driver 13 for SQL Server, and then select Next.

      3. Enter a name for the DSN file, or click Browse to create the file in a different location.

  2. Click Next to review the summary information, and then click Finish.

Stage 3: Use the Create a New Data Source to SQL Server wizard

In the Create a New Data Source to SQL Server wizard, do the following:

  1. On page one, enter identification information:

    • In the Description box, optionally enter documentary information about the DSN file.

    • In the Server box, enter the name of the SQL Server. Do not click the down arrow.

  2. On page two, select one of the following authentication methods:

    • With Integrated Windows authentication    Connect through a Windows user account. Optionally, enter a Service Principle name (SPN). For more information, see Service Principal Names (SPNs) in Client Connections (ODBC).

    • With SQL Server authentication…    Connect with credentials that have been set up in the database by entering the login ID and password.

  3. On pages three and four, select various options to customize your connection. For more information about these options, see Microsoft ODBC Driver for SQL Server.

  4. A screen appears to confirm your settings. Select Test Data Source to confirm your connection.

  5. You may need to login to the database. In the SQL Server Login dialog box, enter the login ID and password. To change additional settings, select Options.

Stage 4: Select tables and views to link to or import

  1. In the Link Tables or Import Objects dialog box, under Tables, select each table or view that you want to link or import, and then click OK.

    List of tables to link or import
  2. In a link operation, decide whether to select Save Password.

    Security    Selecting this option eliminates the need to enter credentials each time you open Access and access the data. But, this stores an unencrypted password in the Access database, which means people who can access the source contents can see the user name and password. If you select this option, we strongly recommend storing the Access database in a trusted location and creating an Access database password. For more information, see Decide whether to trust a database and Encrypt a database by using a database password.

    Note    If you decide not to save the password, but then change your mind, you need to delete and re-create the linked table, and then select Save Password.

Stage 5: Create specifications and tasks (Import only)


When a link or import operation completes, the tables appear in the Navigation Pane with the same name as the SQL Server table or view combined with the owner name. For example, if the SQL name is dbo.Product, the Access name is dbo_Product. If that name is already in use, Access appends "1" to the new table name — for example, dbo_Product1. If dbo_Product1 is also already in use, Access will create dbo_Product2, and so on. But you can rename the tables to something more meaningful.

In an import operation, Access never overwrites a table in the database. Although you cannot directly append SQL Server data to an existing table, you can create an append query to append data after you have imported data from similar tables.

In a link operation, if columns are read-only in an SQL Server table, they are also read-only in Access.

Tip    To see the connection string, hover over the table in the Access navigation pane.

Update the linked table design

You can’t add, delete, or modify columns or change data types in a linked table. If you want to make design changes, do it in the SQL Server database. To see the design changes in Access, update the linked tables:

  1. Select External Data > Linked Table Manager.

  2. Select each linked table you want to update, select OK, and then select Close.

Compare data types

Access data types are differently named from SQL Server data types. For example, a SQL Server column of the bit data type is imported or linked into Access with the Yes/No data type. For more information, see Comparing Access and SQL Server data types.

You can work with data stored in SQL Server either by linking to it or importing the data into an Access database. Linking is a better option if you share the data with others because the data is stored in a centralized location and you can view the most current data, add or edit the data, and run queries or reports in Access.

Step 1: Preparation for linking

  1. Locate the SQL Server database that you want to link to. If necessary, contact the database administrator for connection information.

  2. Identify the tables and views you’ll be linking to in the SQL database. You can link to multiple objects at a time.

Review the source data for the following considerations:

  • Access supports up to 255 fields (columns) in a table, so the linked table will include only the first 255 fields of the object you link to.

  • The columns that are read-only in a SQL Server table will also be read-only in Access.

  1. To create the linked table in a new database: Click File > New >Blank desktop database. To create the linked tables in an existing Access database, make sure that you have the necessary permissions to add data to the database.

    Note: A linked table created in an existing Access database, gets the same name as in the source object. So, if you already have another table with the same name, the new linked table name has a “1” added to it — for example, Contacts1. (If Contacts1 is also already in use, Access will create Contacts2, and so on.)

Step 2: Linking to data

When linking to a table or view in a SQL Server database, Access creates a new table (known as a linked table) that reflects the structure and contents of the source table. You can change the data either in SQL Server, or in Datasheet view or Form view from Access and the changes are reflected in both SQL and Access. Any structural changes to linked tables like removing or changing columns, have to be made from the SQL Server and not Access.

  1. Open the destination Access database.

  2. On the External Data tab, click ODBC Database.

  3. Click Link to the data source by creating a linked table > OK and follow the steps in the wizard.In the Select Data Source box, if the .dsn file you want to use already exists, click the file in the list.

    To create a new .dsn file:

    In the Select Data Source box, click New> SQL Server > Next.

    1. Type a name for the .dsn file, or click Browse.

      Note: You need write permissions to the folder to save the .dsn file.

    2. Click Next to review the summary information, and click Finish.

      Follow the steps in the Create a New Data Source to SQL Server Wizard.

  4. Click OK and under Tables, click each table or view that you want to link to, and then click OK.

If you see the Select Unique Record Identifier, it means that Access was unable to determine which field or fields uniquely identify each row of the source data. Just select the field or combination of fields that is unique for each row, and if you are not sure, check with the SQL Server database administrator.

When the linking operation is complete, you can see the new linked table or tables in the Navigation Pane.

Apply the latest SQL Server object structure

When you open either a linked table or the source object, you see the latest data. However, if any structural changes are made to a SQL Server object, you’ll need to update the linked table(s) to see those changes.

  1. Right-click the table in the Navigation Pane, and then click Linked Table Manager on the shortcut menu.

  2. Select the check box next to each linked table that you want to update, or click Select All to select all of the linked tables.

  3. Click OK > Close.

Note: Since Access data types differ from SQL Server data types, Access links to the most appropriate data type for each column. You can only review not change the assigned data types in Access.

For more information, see ways to share an Access desktop database.

Top of Page

What else should I know?

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!