How to Use Different SQL Server Credentials for Separate Excel Power Query Files
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.

- 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 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.
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.
Launch Excel, navigate to the Data tab on the ribbon, click on 'Get Data', and select 'Data Source Settings'.
In the Data Source Settings dialog, select the 'Global permissions' radio button at the top to view all saved data sources.
Find and select your SQL Server connection in the list, click the 'Clear Permissions' button (or 'Clear All Permissions'), and confirm your choice.
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.

Use Distinct Data Source Aliases or IP Addresses
Trick Excel into treating the same SQL Server as multiple distinct data sources by using different server names, IP addresses, or SQL aliases.
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. Download and Install: Visit the official WPS website to download and install the free WPS Office suite on your computer.
- 2. Open Your Spreadsheets: Launch WPS Spreadsheets and open your existing .xlsx files without worrying about format compatibility.
- 3. Manage Data Seamlessly: Use familiar data management and analysis tools to work on your tables efficiently.

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.




