I'm encountering an issue with a EntityManger created TypedQuery object.
The query below has several named parameters ("otlx", "obrx", "otly", and "obry").
The issue is that when this query gets sent down to SQL Server, it gets converted into the following:
The issue with this is that the group by clause is not recognized as being the same as one of the selected fields and the following error is returned:
If I modify the sp_executesql string to only use @P0 to @P3, it all works fine but you'll notice that right now, even though the named parameters in the original TypedQuery object is the same, the rendered SQL Query has 12 different parameter values!
How would I go about addressing this issue?
SqlServer 2008 R2 +