Share via

Error Creating Column with TMSL

BrandoDisplayName 101 Reputation points
2021-04-15T16:56:07.293+00:00

Hello...

I'm attempting to add a column to an existing tabular model table (1500 level) via SSMS, XMLA Query using the following JSON command(s), neither of which work:

{  
	"create": {  
		"parentObject": {  
			"database": "GeneralAccounting",  
			"table": "CustomDepartmentGrouping"  
		},  
		"column": {  
			"name": "Company 1 Utilization",  
			"dataType": "string",  
			"sourceColumn": "Company 1 Utilization"  
		}  
	}  
}  


{  
	"create": {  
		"parentObject": {  
			"database": "GeneralAccounting",  
			"table": "CustomDepartmentGrouping"  
		},  
		"columns": {  
			"type": "data"  
			"name": "Company 1 Utilization",  
			"dataType": "string",  
			"sourceColumn": "Company 1 Utilization"  
		}  
	}  
}  

Both of these are variations of a sample found in the microsoft documentation here: https://learn.microsoft.com/en-us/analysis-services/tmsl/create-command-tmsl?view=asallproducts-allversions

Whenever I attempt to execute either of the above, I receive the following error(s):

  • "The JSON DDL request failed with the following error: Unrecognized JSON property: column. Check path 'create.column'...
  • "The JSON DDL request failed with the following error: Unrecognized JSON property: columns. Check path 'create.columns'...

I found a no-response post from StackOverflow along the same lines. I also attempted to use BISM Normalizer to generate an update script, only to realize that it uses a full createOrReplace on the database.

Any help on understanding what might be wrong with my JSON would be very much appreciated.

Thanks!

SQL Server Analysis Services
SQL Server Analysis Services

A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.

0 comments No comments

Answer accepted by question author

BrandoDisplayName 101 Reputation points
2021-04-20T12:32:13.663+00:00

I ended up posting the question up on the sql server forum suggested above and ended up finding out that the Add Column method is a "doc bug". So if you want to add a column to a tabular model table via TMSL, you instead have to use the createOrReplace for the entire table definition.

43212126-error-creating-column-with-tmsl

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Lukas Yu -MSFT 5,826 Reputation points
    2021-04-16T08:50:26.207+00:00

    Hi,

    Thanks for the reporting. I did some test and failed too. And I tried some other object approach and I cannot add a column through TMSL.

    For now I cannot tell wether it is a mistake in the documentation or an error inside the core function.

    I will try dig more see if any clue could be found.

    Regards,
    Lukas

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.