I created a new composite entity based on two new entities. Those in turn are based on new views, which are based on new queries. The queries are based on a mix of standard tables and views and custom tables.
Similar composite entities were created in the past and work.
When exporting the composite entity with a data project, I'm getting the following exceptions:
Exception in AX-DIXFRuntime event log:
System.Exception: Incorrect syntax near the keyword 'FROM'.
at Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.DmfEntitySharedTypesProxy.DoWork[T](Func`1 work)
at Dynamics.AX.Application.DMFGenerateSSISPackage.`generateFileDataV2(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution, String _defGroupName, DMFFileFormat _fileFormat, DMFDelimiter _rowDelimiter, DMFDelimiter _columnDelimiter, String _codePage, String _locale, NoYes _isFirstRowHeader, NoYes _unicode, String _source, String _textQualifier, DMFXMLStyle _style, String _rootElement, String _filePath, Map _entitySyncVersion, Int32 _previewCount, Boolean @_entitySyncVersion_IsDefaultSet, Boolean @_previewCount_IsDefaultSet) in xppSource://Source/ApplicationFoundation\AxClass_DMFGenerateSSISPackage.xpp:line 1419
Exception in AX-DIXFSSISRuntime event log:
SSISexceptionMessage System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'FROM'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelper.DMFCompositeEntity.GetDatasetForXMlExport(String stagingString)
at Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelper.DMFCompositeEntity.ExportCompositeEntityToXML()
at Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.Service.ServiceHelper.ExportCompositeEntityToXML(DMFCompositeEntity dmfCompEnt) ClientConnectionId:9a234a11-809d-4d88-828d-8981bfb4faa8 Error Number:156,State:1,Class:15
What I've tried so far:
- refresh the entities and composite entity with en-us language setting
- debug
DMFGenerateSSISPackage.generateFileDataV2
and compare with the export of a working composite entity > no obvious incorrect differences found - remove line entity from the composite entity > same issue
- export header/line entity directly > works without issue
Question
My question is if there is a way to find out what the SQL is that caused the Incorrect syntax near the keyword 'FROM'
exception. If there is no way, I'm happy to hear suggestions how I can further narrow down this issue.