turn off parameterized query

Posts   
 
    
Posts: 20
Joined: 06-Mar-2009
# Posted on: 22-Sep-2009 19:38:52   

Sounds horrible but we need it. We have a partitioned view which combines ten tables. The tables have a composite primary key and based on one of the key's the data goes into the correct table via the view and vice versa for querying So the view is supposed to query only one of the tables based on one of the keys. Except, it doesnt do it because the key is comming in as a parameter and in stead queries all the tables. Sql Server documentation states it should do it, but it doesnt. SQL without parameters seems to work as expected. Does any one know if LLBL can be set to use paramters or not? If so where?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 22-Sep-2009 21:08:02   

AFAIK LLBLGen always uses parameterized queries and cannot be forced to do otherwise. Can you give us some examples of the LLBLGen SQL which fails and the manual SQL which works - we may be able to suggest something else.

Matt

Posts: 20
Joined: 06-Mar-2009
# Posted on: 22-Sep-2009 21:29:07   

The SQL does not fail. The SqlServer engine is searching all the tables that are behind the view. What it should be doing is going directly to the correct table based on one of the keys. The result is higher resource utilization on the server. Again, this is only happening when the key is passed in as a param. We have some work around but none are pretty. I was hopening the adapter may have a property that I can switch but it was a small hope (kind of knew it would be impracticle).

Thanks for repsonse.