[英]MDX query not returning rows in SSIS data flow task?
So I am browsing a SSAS cube in SSMS and using query designer to build my query. 因此,我正在SSMS中浏览SSAS多维数据集,并使用查询设计器来构建查询。 I am only wanting to return dimensions and not measures.
我只想返回尺寸而不是度量。 Here are my steps:
这是我的步骤:
I right click the cube and select browse. 我右键单击该多维数据集,然后选择浏览。 I then drag over the dimensions I want and do not get any results obviously, because I have not selected any measures.
然后,我将鼠标悬停在所需的尺寸上,但由于没有选择任何度量,因此显然没有任何结果。 So I then click the 'show empty cells' option, and bam, there is everything I want!!!
因此,然后单击“显示空单元格”选项,然后运行,这就是我想要的一切!!!
From this point I click 'Design Mode' button to reveal the query. 从这一点上,我单击“设计模式”按钮以显示查询。 The issue is, when I put this query into a data flow task in SSIS, it doesn't return any rows.
问题是,当我将此查询放入SSIS中的数据流任务时,它不返回任何行。
Here is what I have : 这是我所拥有的:
SELECT { } ON COLUMNS, { ([Customer].[Customer].[Customer Number].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Customer]
CELL PROPERTIES VALUE
When I run this in SSMS, I get rows. 当我在SSMS中运行它时,我得到了行。 When I run in SSIS, I get nothing.
当我在SSIS中运行时,我什么也没得到。 How can I return the same rows in SSIS as in SSMS?
如何在SSIS中返回与SSMS中相同的行?
Problem with your query is that it has zero columns - SELECT { } ON COLUMNS
. 查询的问题是它的
SELECT { } ON COLUMNS
零SELECT { } ON COLUMNS
。 This confuses SSIS - it gets zero column dataset. 这使SSIS困惑-它获得零列数据集。 SSIS has to know dataset, its columns and properties like data type, encoding etc. Your query provides no columns and SSIS cannot use it;
SSIS必须知道数据集,其列和属性(如数据类型,编码等)。您的查询不提供任何列,SSIS无法使用它。 although it is Ok from MDX syntax point of view.
尽管从MDX语法的角度来看也可以。
You need to change your query to return some columns, like this (presuming you have hierarchy on [Customer].[Customer].[Customer Number]) 您需要更改查询以返回一些列,例如这样(假设您在[Customer]。[Customer]。[Customer Number]上具有层次结构)
WITH MEMBER [Measures].[Caption] AS [Customer].[Customer].CURRENTMEMBER.MEMBER_CAPTION
MEMBER [Measures].[U_Name] AS [Customer].[Customer].CURRENTMEMBER.UNIQUE_NAME
SELECT { [Measures].[Caption], [Measures].[U_Name] } ON COLUMNS,
{ ([Customer].[Customer].[Customer Number].ALLMEMBERS ) } ON ROWS
FROM [Customer]
This query returns two columns - Caption
and U_Name
. 该查询返回两列-
Caption
和U_Name
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.