There also seems to be a secondary issue to this in the way it selects the
composite key:

... exists (select (topics1_.[ContentId], topics1_.[ChannelId] ) from ...)

also generates "incorrect syntax near ','" even in SQL 2000 compatibility
mode - removing the brackets around the two fields makes the query work
again.

both issues go away when there's not a composite key involved.

James

On 28 July 2010 14:38, James Crowley <[email protected]> wrote:

> Guys - are you aware of an issue with regards to SQL being generated using
> the deprecated
>
> SELECT FROM x,y WHERE ... *condition*
>
> syntax (rather than explicitly defining the joins), when using the SQL 2005
> driver?
>
> It's being generated as part of an "Any()" query by the LINQ provider:
>
>  select top 4 contentvie0_.[UniqueId] ... snip...
>  from ContentView contentvie0_ where
>  (exists (select (topics1_.[ContentId], topics1_.[ChannelId])
>  *from ContentChannelMappingView topics1_, Channel topicview2_ *
>  where contentvie0_.[UniqueId]=topics1_.[ContentId] and
> topics1_.[ChannelId]=topicview2_.[ChannelId]
>  and (topicview2_.Id=1) order by contentvie0_.[PublishedDate] desc
>
> with the clause:
>
> Content.Where(c=>c.Topics.Any(st => st.Topic.Id == 1));
>
> Hadn't noticed it previously because our SQL Server was set in
> compatibility mode.
>
> Thanks
>
> James
>
> ---
> James Crowley
> CEO, developerFusion - the global developer community -
> http://www.developerfusion.com/
> CTO, TechEye - all the technology news unfit for print -
> http://www.techeye.net/
>
> linkedin: http://linkedin.com/in/jamescrowley
> twitter: http://twitter.com/jamescrowley
>



-- 

---
James Crowley
CEO, developerFusion - the global developer community -
http://www.developerfusion.com/
CTO, TechEye - all the technology news unfit for print -
http://www.techeye.net/

linkedin: http://linkedin.com/in/jamescrowley
twitter: http://twitter.com/jamescrowley

Reply via email to