我有兴趣了解从 Analysis Services 检索数据的一些不同方法,以便在代码中的对象中使用或用于最终用户报告。
我过去使用过两种不同的方法,一种是使用 ADOMD 提取结果并将其放入数据集中,另一种是对链接的 SSAS 服务器使用 SQL OPENQUERY 以将结果作为 SQL 存储过程结果集获取。两者各有优点和缺点。
多年来,我在这方面看到了各种问题,所以请原谅我的任何重复,但是还有哪些其他方法可以将 SSAS 数据转换为其他人的代码可以使用的格式呢?
我考虑过通过 HTTP 从 SSAS 获取 XML 结果集,然后使用 Linq to XML – 有人有这方面的经验吗?
理想情况下,我想要一个具有类型列的数据集或具有属性的对象,但我对通用方法比代码示例更感兴趣。除了 SSRS/其他仪表板控件之外,您如何从 SSAS 获取数据?
I’m interested in knowing some different approaches for retrieving data from Analysis Services, to use in either objects in code, or for end-user reporting.
I’ve used two different approaches in the past, one was using ADOMD to pull results and put these into a dataset, the other was using SQL OPENQUERY to a linked SSAS server to get results out as a SQL stored procedure result set. Both of these had advantages and disadvantages.
Over the years I’ve seen various questions along this line, so forgive me for any duplication, but what other methods are there for getting SSAS data into a format where other people’s code could use it?
I’ve considered XML result sets from SSAS over HTTP, then Linq to XML – Anyone have any experience with that?
Ideally I’d like a dataset with typed columns, or objects with properties, but I’m more interested in general approach than code samples. How have you got data from SSAS, apart from SSRS/Other dashboard controls?
发布评论
评论(5)
我知道 MS 应该支持 XML/A(XML for Analysis)。我很快就会发布一个 ajax 库来从网页执行 XML/A 请求。
虽然我目前专注于 Pentaho 的 Mondrian,但它也应该适用于 MS SQL XML/A。如果您有兴趣,我将在 1 月 13 日对此进行演示。(请参阅:http://wiki.pentaho.com/display/COM/January+13,+2010+-+Roland+Bouman+ -+OLAP+and+Analysis+for+web+applications+using+XMLA)我也将在那时发布我的代码(可能在 LGPL 许可证下)
我很乐意从使用其他内容的人那里获得反馈XML/A 服务器,所以如果您有兴趣,那么在这方面合作会很棒。
更新:
该项目现已在 http://code.google.com/p/xmla4js/ 有 API 文档、代码示例和构建脚本。它是 LGPL,因此您可以在您的应用程序中自由使用它,甚至用于商业目的。该许可证确实要求您以 LGPL 形式发布对库本身的任何修改(但这不会影响使用该库的应用程序)
UPDATE2
该项目不驻留在 github 上 https://github.com/rpbouman/xmla4js
它既可以在浏览器中运行,也可以在 Nodejs 中运行。
I know MS is supposed to support XML/A (XML for Analysis). I am shortly releasing an ajax library to do XML/A requests from web pages.
While I am currently focused on Pentaho's Mondrian, it should work for MS SQLs XML/A too. If you are interested, I am doing a presentation on it on January 13. (see: http://wiki.pentaho.com/display/COM/January+13,+2010+-+Roland+Bouman+-+OLAP+and+Analysis+for+web+applications+using+XMLA) I will be releasing my code by that time too (probably underr a LGPL license)
I would love to get feedback from people that use other XML/A servers, so if you are interestd, it would be great to work together on this.
UPDATE:
the project is now available at http://code.google.com/p/xmla4js/ There is API documentation, code samples, and build scripts. It's LGPL so you're free to use it in your applications, even for commercial purposes. The license does require that you release any modifications to the library itself as LGPL (but this does not affect the application that uses the library)
UPDATE2
The project no resides on github at https://github.com/rpbouman/xmla4js
It works in the browser as well as in nodejs.
我自己从未使用过它,因为我们只使用 ADOMD 和 Excel 连接到 SSAS,但在某些时候我们考虑使用 HTTP 和 XML。由于开发计划缩短,我们最终选择了 ADOMD 路线,但我想这是允许访问 .Net 世界之外的 SSAS 的另一种选择。
这是我在原型设计时发现有用的链接: 在 Microsoft Windows Server 2008 上配置对 SQL Server 2008 Analysis Services 的 HTTP 访问
I've never used it myself, as we only use ADOMD and Excel to connect to SSAS, but at some point we considered using HTTP and XML. We ended up going the ADOMD route because of a shortened dev schedule, but I guess it's another option that allows for access to SSAS outside of the .Net world.
Here's a link which I found useful when prototyping: Configuring HTTP Access to SQL Server 2008 Analysis Services on Microsoft Windows Server 2008
XMLA 是一种“强大”的方法——但我不知道有哪个工具包或库能够真正发挥 XMLA 的全部功能;我想你会自己制作它。对于我做过的项目来说,这工作量太大了。
相反,我使用 ADOMD.NET 来检索代码中的结果; CellSet 类尤其丰富。对于最终用户分析(切片和切块),我最常使用 Excel 数据透视图(非常棒!);有时我也使用 Visio 数据透视图。对于固定报告,Reporting Services 可以直接访问 SSAS,甚至有自己的查询生成器。
顺便说一句,如果有帮助的话,我的书中有一章关于将 SSAS 与网站集成作为卸载 SQL Server 的一种方式:超快 ASP.NET.我的代码示例使用 ADOMD;我还将逐步构建一个简单的多维数据集、使用 SSIS 配置自动更新、使用主动缓存、构建简单的 MDX 查询等。
XMLA is the "high power" approach -- but I'm not aware of a toolkit or library that really exposes the full capabilities of XMLA; I think you would have craft it up yourself. For the projects I've done, that's just way too much work.
Instead, I used ADOMD.NET for retrieving results in code; the CellSet class in particular is fairly rich. For end user analysis (slice and dice), most often I use Excel Pivot Charts (which are fabulous!); sometimes I also use Visio Pivot Diagrams. For fixed reporting, Reporting Services can access SSAS directly, and it even has it's own query builder.
BTW, in case it helps, I have a chapter in my book about integrating SSAS with web sites as a way of offloading SQL Server: Ultra-Fast ASP.NET. My code examples use ADOMD; I also walk through building a simple cube, configuring automatic updates with SSIS, using proactive caching, building simple MDX queries, etc.
另一种方法是使用 MSOLAP OLE DB 提供程序。我们的代码目前正在使用这种方法。
Another approach is to use the MSOLAP OLE DB provider. Our code is currently using this method.
将数据从 SSAS OLAP 多维数据集获取到 .NET 的另一种方法(我想说的是最简单的方法)是使用 LINQ + ADO.NET Entity Framework + SSAS 实体框架提供程序。
(我在开发 SSAS Entity Framework Provider 的公司工作)。
Another way (and I would say the simplest one) to get data from SSAS OLAP cubes into .NET is by using LINQ + ADO.NET Entity Framework + SSAS Entity Framework Provider .
(I work for the company that developed SSAS Entity Framework Provider).