use sp_executesql "on demand"
Posted: Thu 22 Oct 2015 14:57
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.
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.