使用TMSL在表格模型中创建关系并不是独立的 [英] Creating relationships in tabular model using TMSL is not working on it's own

查看:97
本文介绍了使用TMSL在表格模型中创建关系并不是独立的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个从元数据创建表格模型的项目。在这个项目中,我有一个表,其中包含表之间的关系。在此表中,我创建了以下JSON文档:

I am working on a project creating tabular models from metadata. In this project I have a table which contains the relationships between tables. From this table I create the following JSON document:

相同的结构适用于表格,角色和度量等内容。但是在SSMS的XMLAQuery窗口中执行此JSON时,我收到以下错误。 

The same structure works for things like tables, roles and measures. But on executing this JSON in an XMLAQuery window in SSMS I get the following error. 

JSON DDL请求失败,出现以下错误:无法识别的JSON属性:关系。检查路径'createOrReplace.relationships',第6行,第17位。

The JSON DDL request failed with the following error: Unrecognized JSON property: relationships. Check path 'createOrReplace.relationships', line 6, position 17..

目前看来,关系不支持createOrReplace。它是否正确?如果是这样,TMSL关系对象上的文档会产生误导(请在此处阅读  https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models-scripting-language-objects/relationships-object- tmsl)

It seems that createOrReplace is not supported for relationships at the moment. Is this correct? If so the documentation on the TMSL relationship object is very misleading (read here https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models-scripting-language-objects/relationships-object-tmsl)

如果它被支持,有人可以指出我为什么会收到此错误吗?

In case it IS supported can someone point me as to why I get this error?

提前致谢!

推荐答案

你好Ruben Jonkers,



谢谢你的提问。



>>>目前似乎不支持createOrReplace用于关系。这是正确的吗?

不,这是不对的。  CreateOrReplace支持关系,必须为"创建或替换"提供完整定义。对象定义的一部分。参见下面的示例TMSL:

Hi Ruben Jonkers,

Thanks for your question.

>>>It seems that createOrReplace is not supported for relationships at the moment. Is this correct?
No, it is not correct.  CreateOrReplace does support relationships, The full definition must be provided for "create or replace" parts of an object definition.See below sample TMSL:

{   
  "createOrReplace": {   
    "database": {   
      "name": "AdventureworksDW2016",   
      "description": "<description>",   
      "tables": [   
        { },   
        { },   
        { }   
      ],   
      "relationships": [   
        { },   
        { }   
      ]   
    }   
  }   
}  


这篇关于使用TMSL在表格模型中创建关系并不是独立的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆