How to Link a SQL Server View with Duplicate Columns to MS Access
Question details
The user needs to link a SQL Server view containing duplicate column names to Microsoft Access but lacks permissions to modify the SQL database.

- Product
- Microsoft Access, SQL Server
- Device & OS
- not provided
- Scenario
- Attempting to connect Access to a SQL Server view containing joined tables with identical field names using read-only database credentials.
- Observed behavior
- Microsoft Access throws an invalid name error (e.g., 'TableName.FieldName') and fails to create a standard linked table because it cannot handle ambiguous field names.
Ensure you have the correct SQL Server ODBC connection string and read permissions for the target database, as well as the names of the duplicate columns you need to alias.
Use an Access Pass-Through Query with Column Aliases
This method bypasses the standard linking process by sending a direct SELECT statement to SQL Server with unique column aliases, requiring only read permissions.
Because you cannot create or alter views on the SQL Server side, an MS Access pass-through query is the most effective workaround. It allows you to assign unique aliases to duplicate column names so Access can read the data without throwing an invalid name error. Note that data retrieved via pass-through queries is generally read-only in Access.
Open your Microsoft Access database, navigate to the 'Create' tab on the ribbon, and click on 'Query Design'. Close the 'Show Table' dialog box without adding any tables.
On the Query Design ribbon, locate the 'Query Type' group and click on 'Pass-Through'.
Click 'Property Sheet' on the ribbon. In the properties pane, find the 'ODBC Connect Str' property and enter your SQL Server connection string (or click the builder button to select your DSN).
In the SQL view window, write a SELECT statement assigning unique aliases to the duplicate columns (e.g., `SELECT TableA.ID, TableA.Name AS TableA_Name, TableB.Name AS TableB_Name FROM YourViewName`).
Click the 'Run' button (the red exclamation mark) on the ribbon or switch to Datasheet View to execute the query and view your data with uniquely named columns.

Boost Your Productivity with WPS Office
While Microsoft Access handles complex database management, WPS Office provides a lightweight, comprehensive suite for your everyday document, spreadsheet, and presentation needs. It is fully compatible with Microsoft Office formats and offers a familiar interface, making it the perfect free alternative for productivity tasks.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the downloaded setup file and follow the simple on-screen instructions to complete the installation.
- 3. Start Creating: Open WPS Office and instantly start working with your existing Microsoft Office files without any formatting loss.

Frequently Asked Questions
Why does Access show an invalid name error when linking a SQL view?
Access cannot handle multiple columns with the exact same name returned by a SQL Server view (often caused by joining tables with identical column names). It requires each column in a linked table to have a unique identifier.
Can I edit data in a pass-through query?
Generally, pass-through queries in Microsoft Access are read-only. If you need to edit the data, you would typically need permission to alter the SQL database to create a properly structured view or link the underlying tables directly.
What if I don't know the exact column names in the SQL view?
If you do not have the view definition, you should contact your database administrator or software vendor to request the appropriate SELECT statement or a list of the exact column names included in the view.
Do I need special permissions to run a pass-through query?
No, a pass-through query only requires standard read (SELECT) permissions for the underlying tables or views in the SQL Server database. You do not need ALTER or CREATE VIEW permissions.




