logo
search
Others

How to Fix ODBC Driver 18 Reporting Wrong Azure SQL Primary Key

John WilsonJohn Wilson Oct 15, 2026 869 views

Question details

The user's client application displays rows as #DELETED# because ODBC Driver 18 misidentifies a BIGINT unique index as the primary key instead of the actual GUID primary key.

How to Fix ODBC Driver 18 Reporting the Wrong Azure SQL Primary Key
Product
Azure SQL / ODBC Driver
Device & OS
not provided
Scenario
Connecting a client application to an Azure SQL database using ODBC Driver 18.
Observed behavior
Rows fetched by the client application incorrectly display as #DELETED# due to driver data-type reporting and primary key misidentification.
Before you start

Ensure you have database administrator access to inspect table schemas in SQL Server Management Studio (SSMS) and verify your client application's active connection strings.

Solution 1Recommended

Verify Schema Definition and Driver Configuration

Confirm the table's exact primary key structure and isolate if the issue is strictly tied to upgrading to ODBC Driver 18.

Client applications tracking row updates require a clearly defined, single primary key. When multiple unique constraints exist (like a GUID and a BIGINT unique index), upgrading your ODBC driver can sometimes alter how these constraints are reported to the frontend, leading to lost row tracking.

1
Inspect column definitions

Open SQL Server Management Studio (SSMS) or your preferred database tool. Check the table design to verify if the GUID and BIGINT fields are separate columns, and confirm which one is explicitly designated as the Primary Key.

2
Check application string conversion

Review your client application settings to see how it handles GUID-to-string conversions. ODBC Driver 18 might be correctly reporting the GUID data type, but the client application may be failing the conversion.

3
Revert and compare drivers

Temporarily change your DSN or connection string to use ODBC Driver 17. Reconnect to the database to see if the #DELETED# error persists. This will determine if the configuration worked previously and isolate the issue to Driver 18.

Verify Schema Definition and Driver Configuration
Note on #DELETED# Errors: Client tools like MS Access typically display #DELETED# when they successfully fetch a row but cannot uniquely identify it during subsequent updates due to missing or misidentified primary keys.
Free Microsoft Office alternative

Analyze Database Exports Easily with WPS Office

While resolving Azure SQL and ODBC Driver 18 connection problems requires backend troubleshooting, managing the exported database reports doesn't have to be complicated. WPS Office serves as a powerful, lightweight alternative to Microsoft Office for editing, visualizing, and sharing your SQL data exports.

  1. 1. Download the software: Visit the official WPS Office website to download the free installation package.
  2. 2. Install the suite: Run the downloaded executable and follow the standard installation prompts to set up the software.
  3. 3. Open your data exports: Launch WPS Spreadsheets to easily open, filter, and analyze your downloaded CSV or XLSX database reports.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv) for seamless data continuity.Lightweight architecture ensures fast loading times, even for massive database export files.Familiar, intuitive tabbed interface eliminates the learning curve for new users.Built-in PDF tools make it easy to generate secure reports from your SQL data.
microsoft office alternative - wps office

Frequently Asked Questions

Why do records show as #DELETED# in my client application?

This typically occurs when the connected client application loses the unique identifier for a row. It is often caused by mismatched primary keys, lacking a timestamp column, or data type conversion errors between the ODBC driver and the application.

Does ODBC Driver 18 require connection encryption by default?

Yes, starting with ODBC Driver 18, the default setting for connection encryption is 'Yes' (Strict). If your server certificate isn't trusted, you may need to add 'TrustServerCertificate=yes' to your connection string.

How can I fix GUID conversion errors in ODBC connections?

Ensure your client application is configured to correctly map the SQL Server UNIQUEIDENTIFIER data type. As a workaround, you can create a SQL View that casts the GUID to a VARCHAR(36) and connect your client application to the view instead of the base table.