You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT [c.CallStack.JobSupplier.Job].[Id] AS [JobId], [c.CallStack.JobSupplier].[Created] AS [StartDate], COUNT(*) AS [CallsMade]
FROM [telem_Calls] AS [c]
INNER JOIN [telem_CallStacks] AS [c.CallStack] ON [c].[CallStackId] = [c.CallStack].[Id]
INNER JOIN [telem_JobSuppliers] AS [c.CallStack.JobSupplier] ON [c.CallStack].[JobSupplierId] = [c.CallStack.JobSupplier].[Id]
INNER JOIN [telem_Jobs] AS [c.CallStack.JobSupplier.Job] ON [c.CallStack.JobSupplier].[JobId] = [c.CallStack.JobSupplier.Job].[Id]
GROUP BY [c.CallStack.JobSupplier.Job].[Id], [c.CallStack.JobSupplier].[Created]
ORDER BY [c.CallStack.JobSupplier].[Created] AS [StartDate]
Note the AS [StartDate] at the end
This is producing an exception
Exception message: Incorrect syntax near the keyword 'AS'.
Stack trace:at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__122_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
Steps to reproduce
I have created a sample project here. Let me know if you need anything more.
Further technical details
EF Core version: Microsoft.EntityFrameworkCore 2.1.3
Database Provider: Microsoft.EntityFrameworkCore.SqlServer 2.1.3
Operating system: Windows 10 Pro Version 10.0.17134 Build 17134
IDE: Visual Studio 2017 15.8.5
The text was updated successfully, but these errors were encountered:
I have a LINQ query
Which is producing incorrect SQL
Note the
AS [StartDate]
at the endThis is producing an exception
Steps to reproduce
I have created a sample project here. Let me know if you need anything more.
Further technical details
EF Core version:
Microsoft.EntityFrameworkCore 2.1.3
Database Provider:
Microsoft.EntityFrameworkCore.SqlServer 2.1.3
Operating system:
Windows 10 Pro Version 10.0.17134 Build 17134
IDE:
Visual Studio 2017 15.8.5
The text was updated successfully, but these errors were encountered: