dbTalk Databases Forums  

HELP! MDX query from Query Analyzer to a Linked Analysis Server

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


Discuss HELP! MDX query from Query Analyzer to a Linked Analysis Server in the microsoft.public.sqlserver.olap forum.



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

Default HELP! MDX query from Query Analyzer to a Linked Analysis Server - 06-08-2005 , 06:56 AM






HI. I am a newbie to OLAP and Analysis Manager so perhaps I have overlooked
something really basic. Please forgive me if this is the case.

I have followed tutorial 1 to build a basic cube in Analysis Manager. The
database is called Tutorial and the cube is called Sales. I have only four
dimensions, which are Customer, Product, Store and Time. These are all
shared, as the tutorial specifies.

When I try and do an MDX query from Query Analyzer to a Linked Analysis
Server using OpenQuery I get the following error.

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSOLAP.2' reported an error. The provider did not give any
information about the error.
OLE DB error trace [OLE/DB Provider 'MSOLAP.2' IDBInitialize::Initialize
returned 0x80004005: The provider did not give any information about the
error.].

Here's a run-down of what I have done. In query Analyzer I linked the server
using the stored procedure.

EXEC sp_dropserver 'LINKED_OLAP'
EXEC sp_addlinkedserver
@server='LINKED_OLAP', -- local SQL name given to the linked server
@srvproduct='', -- not used
@provider='MSOLAP.2', -- OLE DB provider (the .2 means the SQL2K
version)
@datasrc='localhost', -- analysis server name (machine name)
@catalog='Foodmart 2000' -- default catalog/database


then I executed the following.

select * from openquery
( LINKED_OLAP, 'Select {[Measures].[Unit Sales]}
on columns from [Sales] ')

Or

SELECT * FROM OPENQUERY(olap,
'SELECT [unit sales] FROM sales')

Can someone please help me.

I am looking to write queries to reveal the data in the cube. Eventually I
want to be able to write the same queries as pass-throughs from within MS
Access.
Any help will be greatly appreciated.

Robert


Reply With Quote
  #2  
Old   
crank
 
Posts: n/a

Default Re: HELP! MDX query from Query Analyzer to a Linked Analysis Server - 06-13-2005 , 07:23 AM






Robert,
Looks like no one has responded. I've been raking my brain to do something
simple: execute an mdx query interactively using query analyzer. Your post
has at least given some hint. The documentation is not much use. The error I
get (I passed an mdx query using openquery) is 'Syntax error or access
violation'. My analysis server is on the same local machine, running in my
context so access can't be the issue. If you figure out how to make such a
simple thing happen, please reply.
Thanks
Crank

"Robert" <Robert (AT) discussions (DOT) microsoft.com> wrote

Quote:
HI. I am a newbie to OLAP and Analysis Manager so perhaps I have
overlooked
something really basic. Please forgive me if this is the case.

I have followed tutorial 1 to build a basic cube in Analysis Manager. The
database is called Tutorial and the cube is called Sales. I have only
four
dimensions, which are Customer, Product, Store and Time. These are all
shared, as the tutorial specifies.

When I try and do an MDX query from Query Analyzer to a Linked Analysis
Server using OpenQuery I get the following error.

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSOLAP.2' reported an error. The provider did not give
any
information about the error.
OLE DB error trace [OLE/DB Provider 'MSOLAP.2' IDBInitialize::Initialize
returned 0x80004005: The provider did not give any information about the
error.].

Here's a run-down of what I have done. In query Analyzer I linked the
server
using the stored procedure.

EXEC sp_dropserver 'LINKED_OLAP'
EXEC sp_addlinkedserver
@server='LINKED_OLAP', -- local SQL name given to the linked server
@srvproduct='', -- not used
@provider='MSOLAP.2', -- OLE DB provider (the .2 means the SQL2K
version)
@datasrc='localhost', -- analysis server name (machine name)
@catalog='Foodmart 2000' -- default catalog/database


then I executed the following.

select * from openquery
( LINKED_OLAP, 'Select {[Measures].[Unit Sales]}
on columns from [Sales] ')

Or

SELECT * FROM OPENQUERY(olap,
'SELECT [unit sales] FROM sales')

Can someone please help me.

I am looking to write queries to reveal the data in the cube. Eventually I
want to be able to write the same queries as pass-throughs from within MS
Access.
Any help will be greatly appreciated.

Robert




Reply With Quote
  #3  
Old   
Robert
 
Posts: n/a

Default Re: HELP! MDX query from Query Analyzer to a Linked Analysis Serve - 06-13-2005 , 07:49 AM



Hi,

I got my MDX query to work in QA.

After creating the linked server, you want to execute the following...

EXEC sp_helpserver /* this tells you what linked servers you have.

Then, go into SQL Server Enterprise Manager after creating the linked server
(via the stored procedure), and select the Properties. Change the catalog
name to the database you created in Analysis Manager. In my case I had to
rename it to 'Tutorial', because that what I named the database following the
demo.
I ran the query and everything worked. Try using a simple example first.

SELECT * FROM OPENQUERY(LINKED_OLAP,
'SELECT [unit sales] FROM sales')

I hope you get it working.

"crank" wrote:

Quote:
Robert,
Looks like no one has responded. I've been raking my brain to do something
simple: execute an mdx query interactively using query analyzer. Your post
has at least given some hint. The documentation is not much use. The error I
get (I passed an mdx query using openquery) is 'Syntax error or access
violation'. My analysis server is on the same local machine, running in my
context so access can't be the issue. If you figure out how to make such a
simple thing happen, please reply.
Thanks
Crank

"Robert" <Robert (AT) discussions (DOT) microsoft.com> wrote in message
news:A8C14FF0-DCD5-4C10-9158-9E4AEAFCEE4C (AT) microsoft (DOT) com...
HI. I am a newbie to OLAP and Analysis Manager so perhaps I have
overlooked
something really basic. Please forgive me if this is the case.

I have followed tutorial 1 to build a basic cube in Analysis Manager. The
database is called Tutorial and the cube is called Sales. I have only
four
dimensions, which are Customer, Product, Store and Time. These are all
shared, as the tutorial specifies.

When I try and do an MDX query from Query Analyzer to a Linked Analysis
Server using OpenQuery I get the following error.

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSOLAP.2' reported an error. The provider did not give
any
information about the error.
OLE DB error trace [OLE/DB Provider 'MSOLAP.2' IDBInitialize::Initialize
returned 0x80004005: The provider did not give any information about the
error.].

Here's a run-down of what I have done. In query Analyzer I linked the
server
using the stored procedure.

EXEC sp_dropserver 'LINKED_OLAP'
EXEC sp_addlinkedserver
@server='LINKED_OLAP', -- local SQL name given to the linked server
@srvproduct='', -- not used
@provider='MSOLAP.2', -- OLE DB provider (the .2 means the SQL2K
version)
@datasrc='localhost', -- analysis server name (machine name)
@catalog='Foodmart 2000' -- default catalog/database


then I executed the following.

select * from openquery
( LINKED_OLAP, 'Select {[Measures].[Unit Sales]}
on columns from [Sales] ')

Or

SELECT * FROM OPENQUERY(olap,
'SELECT [unit sales] FROM sales')

Can someone please help me.

I am looking to write queries to reveal the data in the cube. Eventually I
want to be able to write the same queries as pass-throughs from within MS
Access.
Any help will be greatly appreciated.

Robert





Reply With Quote
  #4  
Old   
crank
 
Posts: n/a

Default Re: HELP! MDX query from Query Analyzer to a Linked Analysis Serve - 06-14-2005 , 01:52 AM



Thank you very much indeed.
Turned out I genuinely had a syntax error (not an access violation). I was
using curly braces {} instead of ( ) after OpenQuery. That's how the help
showed it. Your syntax had ( ).
Oh for useful documentation.
Thanks again

"Robert" <Robert (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I got my MDX query to work in QA.

After creating the linked server, you want to execute the following...

EXEC sp_helpserver /* this tells you what linked servers you have.

Then, go into SQL Server Enterprise Manager after creating the linked
server
(via the stored procedure), and select the Properties. Change the catalog
name to the database you created in Analysis Manager. In my case I had to
rename it to 'Tutorial', because that what I named the database following
the
demo.
I ran the query and everything worked. Try using a simple example first.

SELECT * FROM OPENQUERY(LINKED_OLAP,
'SELECT [unit sales] FROM sales')

I hope you get it working.

"crank" wrote:

Robert,
Looks like no one has responded. I've been raking my brain to do
something
simple: execute an mdx query interactively using query analyzer. Your
post
has at least given some hint. The documentation is not much use. The
error I
get (I passed an mdx query using openquery) is 'Syntax error or access
violation'. My analysis server is on the same local machine, running in
my
context so access can't be the issue. If you figure out how to make such
a
simple thing happen, please reply.
Thanks
Crank

"Robert" <Robert (AT) discussions (DOT) microsoft.com> wrote in message
news:A8C14FF0-DCD5-4C10-9158-9E4AEAFCEE4C (AT) microsoft (DOT) com...
HI. I am a newbie to OLAP and Analysis Manager so perhaps I have
overlooked
something really basic. Please forgive me if this is the case.

I have followed tutorial 1 to build a basic cube in Analysis Manager.
The
database is called Tutorial and the cube is called Sales. I have only
four
dimensions, which are Customer, Product, Store and Time. These are all
shared, as the tutorial specifies.

When I try and do an MDX query from Query Analyzer to a Linked Analysis
Server using OpenQuery I get the following error.

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSOLAP.2' reported an error. The provider did not give
any
information about the error.
OLE DB error trace [OLE/DB Provider 'MSOLAP.2'
IDBInitialize::Initialize
returned 0x80004005: The provider did not give any information about
the
error.].

Here's a run-down of what I have done. In query Analyzer I linked the
server
using the stored procedure.

EXEC sp_dropserver 'LINKED_OLAP'
EXEC sp_addlinkedserver
@server='LINKED_OLAP', -- local SQL name given to the linked
server
@srvproduct='', -- not used
@provider='MSOLAP.2', -- OLE DB provider (the .2 means the SQL2K
version)
@datasrc='localhost', -- analysis server name (machine name)
@catalog='Foodmart 2000' -- default catalog/database


then I executed the following.

select * from openquery
( LINKED_OLAP, 'Select {[Measures].[Unit Sales]}
on columns from [Sales] ')

Or

SELECT * FROM OPENQUERY(olap,
'SELECT [unit sales] FROM sales')

Can someone please help me.

I am looking to write queries to reveal the data in the cube.
Eventually I
want to be able to write the same queries as pass-throughs from within
MS
Access.
Any help will be greatly appreciated.

Robert







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.