EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB47913: "Incorrect syntax near..." error occurs when executing a document in MicroStrategy Web 9.x and 10.x against a SQL Server 200x database


Community Admin

• Strategy


"Incorrect syntax near..." error occurs when executing a document in MicroStrategy Web 9.x and 10.x against a SQL Server 200x database

SYMPTOM:
 
When executing a document in Strategy Web 9.4.1 against a SQL Server 200x warehouse, the following error is seen:
 


Message not found in user history list. It may have been deleted from other session already. Please refresh your history list.QueryEngine encountered error: Execute Query failed. Error type: Odbc error. Odbc operation attempted: SQLExecDirect. Incorrect syntax near 'Writer'. Incorrect syntax near 'a21'. Connection String: DSN=PIM PROD;UID=pimbi;DB=PIMDB;PORT=1433;HOST=192.168.121.21;. SQL Statement: select count(a21.Copy Writer) WJXBFS1 from (select distinct from dbo.VW_BBBY_COPY_PROOFING_BI) a21.. Error in Process method of Component: QueryEngineServer, Project PIM Reporting, Job 32668, Error Code= -2147212544.)

 
In DSSErrors, the following error is seen:
 

Execute Query failed. 
Error type: Odbc error. Odbc operation attempted: SQLExecDirect. Incorrect syntax near 'Writer'. Incorrect syntax near 'a21'. Connection String: DSN=PIM PROD;UID=pimbi;DB=PIMDB;PORT=1433;HOST=192.168.121.21;. SQL Statement: select count(a21.Copy Writer)  WJXBFS1
from (select distinct from dbo.VW_BBBY_COPY_PROOFING_BI) a21.

 
CAUSE:
This error is caused by spaces in the column names. In the above error, the column name "Copy Writer" is causing the issue.
 
ACTION:
Since it is generally not recommended to have spaces in column names, the best solution is to change the column names so that the spaces are removed. This will resolve the issue at hand and also potentially prevent future issues. However, if this is not possible, column aliases can be used to remove the spaces from the names.


Comment

0 comments

Details

Knowledge Article

Published:

May 27, 2017

Last Updated:

May 27, 2017