Power Query Problems

How to Use Different SQL Server Credentials for Separate Excel Power Query Files

Nimra MalikNimra Malik Oct 16, 2026 871 views

Question details

The user needs to use distinct SQL Server credentials for different Excel workbooks using Power Query, but Excel caches the credentials per data source, causing permission conflicts.

How to Use Different SQL Server Credentials for Separate Excel Files in Power Query
Product
Microsoft Excel
Device & OS
not provided
Scenario
Accessing a SQL Server database from multiple Excel files where each file requires different table permissions and separate logins.
Observed behavior
Power Query reuses the globally cached SQL Server login for the data source instead of prompting for different credentials per workbook, preventing access to the required tables.
Before you start

Before modifying your credential settings, ensure you have the correct SQL Server login details (username and password) and verify which database tables each account is authorized to access.

Solution 1Recommended

Clear and Re-enter Credentials in Data Source Settings

Manually clear the global credentials for the SQL Server data source so Excel prompts for a new login when you open a different workbook.

Because Excel stores credentials globally for each connection string, the most direct workaround is to clear the saved credentials before opening a file that requires a different login. This forces Power Query to ask for authentication again.

1
Open Data Source Settings

Launch Excel, navigate to the Data tab on the ribbon, click on 'Get Data', and select 'Data Source Settings'.

2
Locate Global Permissions

In the Data Source Settings dialog, select the 'Global permissions' radio button at the top to view all saved data sources.

3
Clear Saved Credentials

Find and select your SQL Server connection in the list, click the 'Clear Permissions' button (or 'Clear All Permissions'), and confirm your choice.

4
Reconnect with New Credentials

Open your specific workbook and attempt to refresh the Power Query. Excel will prompt you to enter the new SQL Server credentials specific to that file.

Clear and Re-enter Credentials in Data Source Settings
Frequent Reconnection: This method requires manually clearing permissions each time you switch between files that need different logins.
Free Microsoft Office alternative

Need a Lightweight, Hassle-Free Spreadsheet Solution? Try WPS Office

If you are tired of complex workarounds for data connections and software limitations, consider WPS Office. It provides a lightweight, highly compatible alternative to Microsoft Office, ensuring your spreadsheet tasks are efficient and accessible without heavy licensing costs.

  1. 1. Download and Install: Visit the official WPS website to download and install the free WPS Office suite on your computer.
  2. 2. Open Your Spreadsheets: Launch WPS Spreadsheets and open your existing .xlsx files without worrying about format compatibility.
  3. 3. Manage Data Seamlessly: Use familiar data management and analysis tools to work on your tables efficiently.
Fully compatible with Microsoft Excel (.xlsx, .xls) and CSV formats.Lightweight installation with fast loading times for large datasets.Free to use with a familiar, easy-to-navigate tabbed interface.Built-in tools for data analysis, filtering, and seamless data management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query use the same credentials for all my Excel files?

Power Query stores credentials at the application level under 'Global Permissions' based on the specific data source connection string (like the Server Name). Any workbook connecting to that exact string automatically reuses the cached credentials.

Can I save SQL credentials directly inside a specific Excel workbook?

No, Microsoft Excel currently does not support saving distinct SQL Server credentials on a per-workbook basis. All database credentials are saved globally in the application's Data Source Settings.

What is the best practice if multiple users need to refresh data with their own permissions?

The most effective practice is to have each user connect using Windows Authentication (Active Directory) rather than SQL Server authentication. This automatically passes their individual Windows login credentials to the SQL Server, applying their specific table permissions without manual credential entry.

How do I completely reset all my Power Query data source credentials?

Navigate to the Data tab, click 'Get Data', and select 'Data Source Settings'. Ensure you are on the 'Global permissions' tab, then click 'Clear All Permissions' at the bottom to wipe all saved credentials from Excel.