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

KB40169: "Duplication of column in a table, derived table, view, macro or trigger" error occurs when executing a report using Global Optimization Level 4 if two metrics use the same column alias in MicroStrategy SQL Engine 9.4.x


Qinyi Chen

Quality Engineer, Principal • Strategy


This article describes an issue with column names when using global optimization with MicroStrategy SQL Engine 9.4.x.

SYMPTOM:
Users notice that when generating SQL for a report containing Custom Groups, the following error is thrown:
 
 Execute Query failed.
Error type: Odbc error. Odbc operation attempted: SQLExecDirect. Duplication of column COLUMN_NAME in a table, derived table, view, macro or trigger.  Connection String: DSN=DSN_NAME;UID=USER_NAME;. SQL Statement: create volatile table VOLATILE_TABLE NAME 0, no fallback, no log
 
This occurs for projects which use Teradata for the data warehouse and reports which use Global optimization Level 4.  
 
CAUSE:
This issue is caused when two metrics used by the report are using the same Column Alias in Strategy.   When the SQL Engine creates the column name for the temporary table, it assigns a number to the end of each column to distinguish (e.g COLUMN1 and COLUMN2).    Due to a 30-character limit in Teradata for column names,  the number for long names becomes truncated resulting in duplicate column names in the SQL.   
This is a known issue in Strategy 9.4.x.
 
ACTION:
Upgrade to Strategy 10. This has been addressed by the last valid character in the 30 character limit being changed to the necessary identifying number to prevent duplicate column names.
 
WORKAROUND:
Modify the column aliases to be different for each metric used in the report.
Note:
After Strategy 2020, with Data Engine version Strategy 2020, the Unified Quoting feature will retain special characters, e.g., white space, in the metric alias. This may increase the number of characters truncated, and increase the chance that two column aliases become duplicated. If the two metric aliases are in different cases, for example, one is "Column," and the other one is "column," the Engine will not treat them as the same, and the Engine will not assign a number to the end of each column to distinguish. However, if the database is case insensitive, "Column" and "column" will be treated as duplicates, and the database will return an error. This does not indicate that the truncating or distinguishing workflow has been broken. For example, if the warehouse is on a Teradata Database, with the Unified Quoting feature, the Engine no longer converts the alias to the upper case before sending them to the warehouse, and the report may fail if two column alias are named "Column" and "column." 
Workaround:
There are two ways to avoid this issue:

  1. You can rename the metrics to be consistent with the case. In that way, the Engine will treat the aliases as duplicate and assign the number to distinguish them.
  2. Turn off the Database Instance level VLDB setting "Default to Metric Name."

Comment

0 comments

Details

Knowledge Article

Published:

April 11, 2017

Last Updated:

July 16, 2020