How to Fix ODBC Driver 18 Reporting Wrong Azure SQL Primary Key
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.

- 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.
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.
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.
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.
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.
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.

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. Download the software: Visit the official WPS Office website to download the free installation package.
- 2. Install the suite: Run the downloaded executable and follow the standard installation prompts to set up the software.
- 3. Open your data exports: Launch WPS Spreadsheets to easily open, filter, and analyze your downloaded CSV or XLSX database reports.

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.




