【问题标题】:SSAS Tabular Add Column via TMSL通过 TMSL 的 SSAS 表格添加列
【发布时间】:2018-02-23 19:03:29
【问题描述】:

早安,

目标:我正在尝试向 SSAS 表格模型表添加新列。长期目标是在需要时以编程方式进行大批量更改。

我找到的资源: https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models-scripting-language-commands/create-command-tmsl

这个给出了我一直在关注的模板,但似乎不起作用。

到目前为止我所尝试的:

{
  "create": {  
    "parentObject": {  
      "database": "TabularModel_1_dev"
      , "table": "TableABC"
    }, 
    "columns": [
        {
        "name":  "New Column"
        , "dataType": "string"
        , "sourceColumn": "Column from SQL Source"
        }
    ]   
  }
}

第一个最符合示例,但返回以下错误:

"The JSON DDL request failed with the following error: Unrecognized JSON property: columns. Check path 'create.columns', line 7, position 15.."

尝试二:

{
  "create": {  
    "parentObject": {  
      "database": "TabularModel_1_dev"
      , "table": "TableABC"
    }, 
    "table": {
    "name": "Item Details by Branch",
    "columns": [
        {
        "name":  "New Column"
        , "dataType": "string"
        , "sourceColumn": "New Column"
        }
    ]
    }
  }
}

在子列表中添加表格也会返回错误;

"...Cannot execute the Create command: the specified parent object cannot have a child object of type Table.." 

在 parentObject 中省略表也不成功。

【问题讨论】:

    标签: ssas-tabular


    【解决方案1】:

    我知道这篇文章已经过去三年了,但我也在尝试同样的事情,并在我的探索中偶然发现了这篇文章。我最终联系了微软,并被告知他们在文档中提供的添加列示例是一个“文档错误”。事实上,您不能只添加一列,您必须通过 createOrReplace 为其提供整个表定义。

    SSAS Error Creating Column with TMSL

    【讨论】:

      猜你喜欢
      • 2020-11-25
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 2020-11-17
      • 1970-01-01
      • 1970-01-01
      • 2018-07-26
      • 2019-11-21
      相关资源
      最近更新 更多