KNOWLEDGE BASE

Error "Incorrect syntax near the keyword ... Statement(s) could not be prepared" Creating Extract


Published: 07 Nov 2013
Last Modified Date: 19 Nov 2017

Issue

When creating an extract of a Microsoft SQL Server data source, the following error might occur:

[Microsoft][ODBC SQL Server Driver][SQL Server] Incorrect syntax near the keyword 'on'.
[Microsoft][ODBC SQL Server Driver][SQL Server] Incorrect syntax near 'TableauSQL'.
[Microsoft][ODBC SQL Server Driver][SQL Server] Statement(s) could not be prepared

Environment

  • Tableau Desktop
  • Microsoft SQL Server
  • ODBC Driver

Resolution

  1. Upgrade Microsoft SQL Server driver to current version.
  2. Use native Microsoft SQL Server connector instead of using ODBC connector.
Did this article resolve the issue?