Others

Handle the WSID Parameter in an Excel ODBC SQL Server Connection

Natalie TaylorNatalie Taylor Nov 13, 2026 869 views

Question details

The user needs to understand how an Excel ODBC connection's WSID parameter affects a SQL Server report that filters results using HOST_NAME().

Handle the WSID Parameter in an Excel ODBC SQL Server Connection
Product
Microsoft Excel, ODBC, and Microsoft SQL Server
Device & OS
not provided
Scenario
An Excel workbook connects to SQL Server through ODBC, and the report uses HOST_NAME() to select records for a workstation.
Observed behavior
Excel may retain a WSID value in the connection string, causing HOST_NAME()-based filtering to use the specified workstation identifier rather than the computer currently opening the workbook.
Before you start

Identify the workbook connection, Excel version, and ODBC driver name and version. Before sharing connection details, remove passwords, tokens, and sensitive server or database information.

Solution 1Recommended

Inspect the WSID Value and Request SQL Server Connection Guidance

Use this approach to identify the connection settings involved and provide a database specialist with the information needed to investigate the filtering behavior.

WSID is a workstation identifier supported by SQL Server ODBC drivers. SQL Server's HOST_NAME() returns the workstation name supplied by the client connection, so an explicitly stored WSID can affect reports that filter on that value.

This behavior involves Excel, the ODBC driver, and SQL Server. The appropriate fix depends on the driver, connection configuration, and intended report filtering; there is no universal Excel setting that resolves every case.

1
Open the connection properties

In Excel, go to Data > Queries & Connections, open the Connections tab, right-click the relevant connection, and select Properties. In older Excel versions, use Data > Connections, select the connection, and click Properties.

2
Inspect the connection string

In Connection Properties, open the Definition tab and inspect the Connection string field for WSID. Record whether it names the computer where the connection was originally created. If the connection string is managed elsewhere, inspect the associated ODBC data source or query connection settings instead.

3
Document the report filter

Ask the SQL Server report owner to review the query or stored procedure for HOST_NAME(). Record whether the intended filter should follow the current computer, the signed-in user, or an explicit report parameter.

4
Gather reproducible details

Record the Excel version from File > Account > About Excel. Obtain the ODBC driver name and version from the connection administrator or ODBC Data Source Administrator, and prepare a redacted connection string plus an example of the expected and actual results.

5
Ask a database-focused support community

Open Microsoft Q&A or a SQL Server community forum and post the driver version, Excel version, redacted connection string, HOST_NAME()-based filter, and desired behavior. Ask whether the driver and Excel connection should omit, update, or otherwise manage WSID for your scenario.

Inspect the WSID Value and Request SQL Server Connection Guidance
HOST_NAME() is not a security identity: The workstation name is supplied by the client and can be changed. Do not use HOST_NAME() as the basis for security or access control; ask the database administrator to review any such filtering.
Free Microsoft Office alternative

Use WPS Office for Everyday Spreadsheet Work

WPS Office is a free, lightweight alternative with a familiar interface and support for Microsoft Excel file formats, making migration straightforward for everyday spreadsheet work. It does not resolve Excel's ODBC WSID behavior or SQL Server HOST_NAME() filtering; validate database-connected workflows separately before switching.

Open and edit Microsoft Excel .xlsx and .xls files.Review exported SQL Server report data in spreadsheets without relying on the original live ODBC connection.Work with a familiar spreadsheet interface for straightforward migration.Use a free, lightweight office suite for everyday documents and reports.
microsoft office alternative - wps office

Frequently Asked Questions

Why does HOST_NAME() return the computer where the Excel connection was created?

If the saved ODBC connection string includes a WSID value naming that computer, the driver can supply that value to SQL Server. Inspect Excel's Data > Queries & Connections > Connections > Properties > Definition to check the stored connection string.

Can I delete WSID from the connection string?

Some SQL Server ODBC drivers use the local computer name when WSID is omitted, but the outcome depends on the driver and how Excel saves or rebuilds the connection. Consult the driver documentation or a database specialist, then test an approved change and refresh the connection to verify the report results.

Should I use HOST_NAME() to restrict which records a user can access?

No. HOST_NAME() is client-supplied and is not a trusted security identity. Ask your SQL Server administrator to use an appropriate authorization mechanism. For non-security report selection, an explicit report parameter may be more predictable.

What should I include in a Microsoft Q&A support request?

Include the Excel version, ODBC driver name and version, a redacted connection string showing WSID, the relevant HOST_NAME() filter, and expected versus actual results. Explain whether the workbook is being opened on a different computer, and do not post credentials.