Re: WHERE 1=2 with performance nightmares



Ralf Jansen wrote:
Your SQL looks like you are not using parameters. If so you should set Paramcheck = false for you ADOQuery/ADODataset. The dataset won't check for parameters then and this will prevent the provider from generating the SET FMTONLY query at all.


Thanks Ralf,

That appears be a lot of work in the current product as we have a ton of places that sometimes expect params and sometimes not.
As if that's not enough the product allows end users to add components and queries to the forms where even stored procedures are executed through queries.
But anyway I will turn off the Paramcheck wherever it's possible.
No more excuses! ;)

But what really bothers me is,
this "WHERE 1=2" was not there in the older trace files.
It has recently started appearing.
I have ruled out my newer versions by testing with older versions that never had this issue. It's *now* showing up with older versions too.

Also, the number of columns got nothing to do with it.
It happens with more columns as well.

However, this occurs only with our application! :(
The same queries executed through Management Studio or even from a test app does not have this problem.

As someone suspected it could be some api doing to our app.
Don't know how to turn that off..

Thanks,
Sarah

.