dbTalk Databases Forums  

checking OLAP rowcounts with MDX queries, from stored procedure

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss checking OLAP rowcounts with MDX queries, from stored procedure in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sylvia
 
Posts: n/a

Default checking OLAP rowcounts with MDX queries, from stored procedure - 06-13-2005 , 11:43 AM






Hello all,

Thanks for any help on this one.

We have a source database for our Analysis Server database, which has
no foreign keys/referential integrity. This is not something I can
change.

We have had problems of records being dropped out when the cubes are
built, because of the referential integrity issues - i.e. there's a
foreign key that's not in the parent table, so the record never shows
up in the cube.

What I need is a means where I can easily check, in a stored procedure,
what the rowcount is for a certain date range (or maybe just for a
certain partition? Or perhaps the sum of a certain measure? Any of
these would work) and then compare it against the table rowcount in SQL
Server. For instance:

Select @TableSum = sum(TotalSold) from RevenueTable where DateSold
between @StartDate and @EndDate

Select @OlapSum = sum(TotalSold) from RevenueCube where DateSold
between @StartDate and @EndDate

if @TableSum <> @OlapSum then print 'Something is wrong!!!'

The part that I don't know how to do (or even if it's possible) is how
to reference the cube via MDX from a stored procedure.

Any ideas greatly appreciated!

Sylvia


Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: checking OLAP rowcounts with MDX queries, from stored procedure - 06-13-2005 , 11:56 AM






See Appendix F in the AS Operations Guide
http://www.microsoft.com/technet/pro.../anservog.mspx
It shows how to establish a linked server with AS and then issue a MDX query
against it.
Keep the query simple because what is returned is a flattened rowset, not a
multi-dimensional cellset -- but that should be OK because you just want the
"total" value anyway.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Sylvia" <Puget4753 (AT) yahoo (DOT) com> wrote

Quote:
Hello all,

Thanks for any help on this one.

We have a source database for our Analysis Server database, which has
no foreign keys/referential integrity. This is not something I can
change.

We have had problems of records being dropped out when the cubes are
built, because of the referential integrity issues - i.e. there's a
foreign key that's not in the parent table, so the record never shows
up in the cube.

What I need is a means where I can easily check, in a stored procedure,
what the rowcount is for a certain date range (or maybe just for a
certain partition? Or perhaps the sum of a certain measure? Any of
these would work) and then compare it against the table rowcount in SQL
Server. For instance:

Select @TableSum = sum(TotalSold) from RevenueTable where DateSold
between @StartDate and @EndDate

Select @OlapSum = sum(TotalSold) from RevenueCube where DateSold
between @StartDate and @EndDate

if @TableSum <> @OlapSum then print 'Something is wrong!!!'

The part that I don't know how to do (or even if it's possible) is how
to reference the cube via MDX from a stored procedure.

Any ideas greatly appreciated!

Sylvia




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.