
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Incorrect syntax near keyword <fieldname> when loading data from MS SQL Server/ Azure SQL database
May 17, 2021 3:23:42 AM
Mar 20, 2017 6:01:00 AM
Loading data from Microsoft SQL Server or Azure SQL databases to Qlik Sense fails at one or more specific fields. Upon excluding these fields, the reload works normally.
Error message shown in the data load progress dialogue and document log is Incorrect syntax near keyword <fieldname> or Connector reply error ***, although Qlik Sense script editor does not prompt for any syntax error.
The issue is only observed when a number of specific words, such as "Function" or "References", are used as field names in the database.
Resolution:
Tables/ columns named with reserved keywords should be quoted with double quotes or square brackets in order for the containing SQL query to work.
Cause:
Words like "Function", "References" are reserved keywords for Microsoft SQL Server or Azure SQL databases, which cannot be used directly as object names in SQL queries.
A complete list of reserved keywords for for Microsoft SQL Server or Azure SQL can be found at https://msdn.microsoft.com/en-us/library/ms189822.aspx