Symptom
After upgrading the database to SQL Server 2022 CU21 (released in September 2025), the retrieve performance of some DataWindows that execute complex SQL statements may noticeably decrease.
Environment
PowerBuilder - All versions
Cause
When a PowerBuilder application executes SQL statements, the generated query plan may not use the correct index. However, running the same SQL in SQL Server Management Studio (SSMS) does not show performance issues because the two environments generate different query plans.
This occurs because SSMS sets ARITHABORT to ON by default, while PowerBuilder does not explicitly set it and therefore uses the SQL Server engine default setting that sets ARITHABORT to OFF.
Resolution
Please add the following code after establishing the transaction connection in PowerBuilder. Replace SQLCA with the transaction object used by the DataWindow.
EXECUTE IMMEDIATE "SET ARITHABORT ON" USING SQLCA;
Microsoft Official Documentation
Always set ARITHABORT to ON in your logon sessions. Setting ARITHABORT to OFF can negatively impact query optimization, leading to performance issues.
https://learn.microsoft.com/en-us/sql/t-sql/statements/set-arithabort-transact-sql?view=sql-server-ver16