Data Import & Export

How to Manage Excel SQL Connection Strings and User Authentication

Muhammad TalhaMuhammad Talha Nov 3, 2026 869 views

Question details

Users need to understand how to manage permissions, credentials, and privacy settings when an Excel workbook connects to a SQL Server database view.

How to Manage Excel SQL Connection Strings and User Authentication
Product
Microsoft Excel
Device & OS
not provided
Scenario
Connecting an Excel workbook to a SQL Server view to retrieve and refresh data.
Observed behavior
Users require valid Windows or database credentials to refresh data, and data connection privacy settings must be managed to securely share workbooks.
Before you start

Ensure you have the correct SQL Server hostname, database name, and valid login credentials provided by your database administrator before configuring the connection.

Solution 1Recommended

Configure Data Source Settings in Power Query

Update or clear your SQL Server connection credentials to ensure smooth data refresh and appropriate access for your queries.

When connecting to an external database, Excel caches your credentials. If your password changes or another user needs to refresh the data, these credentials must be updated within Power Query.

1
Access Data Source Settings

Open your workbook, navigate to the 'Data' tab on the ribbon, and select 'Get Data' followed by 'Data Source Settings'.

2
Edit Connection Permissions

Locate your SQL Server connection in the list of data sources, click to highlight it, and select 'Edit Permissions'.

3
Update Credentials

Under the 'Credentials' section, click 'Edit' to enter your valid Windows or Database credentials.

4
Apply Privacy Levels

Select the appropriate Privacy Level (such as Organizational or Private) from the dropdown, then click 'Save' and 'Close'.

Configure Data Source Settings in Power Query
Privacy Settings: Privacy settings determine how data can be combined across multiple sources. Choose 'Organizational' if you are sharing within a company domain.

Manage External Data Connections Easily with WPS Spreadsheet

WPS Spreadsheet provides a highly compatible and intuitive interface for importing data, managing external connections, and securing your worksheets.

  1. 1. Open WPS Spreadsheet: Launch WPS Spreadsheet and navigate to the 'Data' tab on the main ribbon.
  2. 2. Import External Data: Click on 'Import Data' to establish a new connection to your external SQL database or data source.
  3. 3. Configure Connection: Input your server credentials and configure the data refresh settings according to your business needs.
  4. 4. Secure Your File: Use the 'Review' tab to protect your workbook structure before sharing it with your team.
Seamless compatibility with Microsoft Excel (.xlsx) formats and data connection structures.Intuitive data import tools for external databases and queries.Robust worksheet and workbook protection features to keep data safe.Lightweight, fast, and completely free to download.
microsoft office alternative - wps office

Frequently Asked Questions

Why am I getting a 'Login failed' error when refreshing Excel data?

This typically occurs if your Windows or database credentials have changed or expired. Go to Data > Get Data > Data Source Settings, select your database from the list, and update your credentials.

How do I hide the SQL query connection string from other users?

To prevent users from viewing or editing the connection string, you can disable the connection properties or protect the entire workbook structure from the Review tab before distributing the file.

Do other users need SQL Server permissions to view my Excel file?

Users can view the static data already loaded into the workbook without SQL permissions. However, if they need to click 'Refresh All' to pull the latest data from the server, they must possess valid SQL Server credentials.

What are privacy levels in Power Query data connections?

Privacy levels (Public, Organizational, Private) determine how data can be isolated or combined from multiple sources. This prevents sensitive internal data from being inadvertently exposed during complex query operations.