This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
on 07-26-202208:31 AM - edited on 07-26-202208:31 AM by ntobon
Error: “[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'column'.”
A column with spatial data and spaces in the column name throws a "Incorrect syntax" error when reading from or writing to SQL Server.
Error when using ODBC:
Input Data (1) Error opening "select "NT_COStoreFileNorth".[new column], "NT_COStoreFileNorth".[polygon column] FROM (SELECT "new column","polygon column".STAsBinary() AS polygon column FROM NT_COStoreFileNorth) "NT_COStoreFileNorth"": No Columns Returned.
Error when using OleDB (with SQL Server Native Client driver):
When using OLEDB (with driver SQL Server Native Client) you get error:
Input Data (3) Error: Microsoft SQL Server Native Client 11.0: Incorrect syntax near the keyword 'column'.\42000 = 156¶ in Query: select NT_COStoreFileNorth.[new column],¶ NT_COStoreFileNorth.[polygon column] ¶from NT_COStoreFileNorth
Versions: 2022.1, 2021.4, 2020.4
SQL Server Driver
Versions: 11, 13, or 17
SQL Server OleDB driver Native Client 11 Driver
This error is caused by the spatial data and the inclusion of spaces in the column name. Other data types do not have the same issue with spaces in the column name.
Defect GDC-2539 has been created for this issue and will be addressed in a future release of Designer.
Rename the SpatialObj column and remove the spaces.