Page 1 of 1

use sp_executesql "on demand"

Posted: Thu 22 Oct 2015 14:57
by Ludek
Hi,
I can see, queries without paremeters are executed directly, queries with parameters using sp_executesql. Is there a flag on a query to FORCE use sp_executesql? without adding dummy parameters? I would like it, as I could then nicely preserve some settings (like set transaction isolation level).
Or, do you have other idea to execute some query with other isolation level? only one query and nothing else? without dummy parameters and without other db connection? setting back to read uncommited at the end of query text is VERY unreliable, especially with fetchall = false.

Thanks, Ludek.

Re: use sp_executesql "on demand"

Posted: Tue 27 Oct 2015 10:20
by azyk
SDAC doesn't use sp_executesql to execute a query with parameters but OLEDB Provider does. We cannot affect this behavior.