SQL Server(SNC) and Multiple Plans
- New
- How-to
- SQL Server
-
Panos Platanas
- PowerBuilder
- Monday, 16 June 2025 04:00 PM UTC
Hi!
We have a big number of queries that have Multiple Plans inside Sql Server.
We are using PowerBuilder 2017 (while we migrate slowly to PB 2025) and SNC driver.
I got the TOP 100 out of them and they are all SELECT clauses from datawindows of our application (got those directly from SQL Server query cache tables)
e.g
SELECT billing_analysis.dummy_id , billing_analysis.bill_id , billing_analysis.date_from , billing_analysis.date_to , billing_analysis.exception_flag , billing_analysis.department_id FROM billing_analysis WHERE ( billing_analysis.bill_id = 2601746 )
I thought it may be this strange whitespaces that Powerbuilder for some reason produces but I found queries without those whitespaces (probably manualy written ones)
eg
SELECT guest_notes.dummy_id, guest_notes.guest_id, guest_notes.guest_notes, ISNULL(guest_notes.merged_guest_id, 0) merged_guest_id FROM guest_notes WHERE guest_notes.guest_id = 6160096
What could I check, investigate or change?
Thank you
-----------------------------------------------------------------------------------------------
EDIT: As John stated below the post is indeed quite vague. Let me rephrase it please:
I am puzzled because we have a simple SNC connection
StaticBind=0,TrimSpaces=1,RecheckRows=1,Identity=SCOPE_IDENTITY() and AutoCommit = TRUE
and we are experiencing LOTS of Multiple Plans inside the SQL Serever cache from simple SELECT queries of the Datawindows.
I was wondering if anyone had such experience and whether they used any methods to eliminate it.
Meanwhile I am going to do a DBCC FREEPROCCACHE in my DEV machine, set PowerBuilder app to SET ANSI_NULLS ON; SET ARITHABORT ON; and try to monitor whether it makes any change.
If it does, I will report back.
Thank you
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.