I notice the select statement that gets executed by MS SQL is a
SELECT FROM (SELECT
Can this be avoided?
I have a DA schema with following SQL
When I execute
var query = dataAdapter.GetTable<OffCloudClient.dadata.RelatieNxN>(queryParameters)
.Where(x => x.rel_type ==OffCloudClient.dadata.RelatieNxN.reltypeProductGroep);
I see that the SQL statement that gets executed is
SELECT [t0].[rel_changedate], [t0].[rel_omschrijving], [t0].[rel_opties], [t0].[rel_primkey], [t0].[rel_subtype], [t0].[rel_type], [t0].[rel_userid]
FROM (SELECT
rel_primkey,rel_changedate,rel_type,rel_opties,rel_omschrijving,
rel_subtype, rel_userid
FROM
[RelatieNxN]
WHERE
(1=1) AND
( (rel_type= @rel_type ) or ( @rel_type = -1) ) AND
( ((rel_opties& @rel_opties )= @rel_opties ) or ( @rel_opties = -1) )
) [t0] WHERE ([t0].[rel_type] = 1)
Can I make linq use my select and just add some WHERE statements?
I assume this will yield better for performance.