Applies ToSQL Server 2016 Developer - duplicate (do not use) SQL Server 2016 Enterprise - duplicate (do not use) SQL Server 2016 Enterprise Core - duplicate (do not use) SQL Server 2016 Standard - duplicate (do not use) SQL Server 2016 Service Pack 1 SQL Server 2017 Developer on Windows SQL Server 2017 Enterprise on Windows SQL Server 2017 Enterprise Core on Windows SQL Server 2017 Standard on Windows

Symptoms

Assume that you use Microsoft SQL Server 2016 and 2017 Change Data Capture (CDC) for Oracle by Attunity to replicate data changes from Oracle databases to SQL Server databases. A table on Oracle contains a column that's named 'KEY', and this column is also the primary key of the table. In this situation, when you use the Change Data Capture Designer for Oracle by Attunity to add this table for capturing changes, an error message that resembles the following might occur:

Incorrect syntax near the keyword 'KEY'.

Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'KEY'.

Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

at Attunity.SqlServer.XdbCdcConfig.Core.Managers.CDCManagerImp.ExecuteBatchSqlInTransaction(String dbName, IList`1 sqlCommands)

at Attunity.SqlServer.XdbCdcConfig.Core.Managers.CDCManagerImp.UpdateCaptureTables(CDCInstanceInfo cdcInfoForUpdate)

at Attunity.SqlServer.XdbCdcDesigner.UI.EditCDCInstanceForm.UpdateCaptureTables()

ClientConnectionId:ConnectionID

Error Number:156,State:1,Class:15 

Resolution

This issue is fixed in the following cumulative updates for SQL Server:

       Cumulative Update 6 for SQL Server 2017

       Cumulative update 8 for SQL Server 2016 SP1

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Latest cumulative update for SQL Server 2017

Latest cumulative update for SQL Server 2016

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References

Learn about the terminologythat Microsoft uses to describe software updates.

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.