By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,787 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

Probem in executing a long Dynamic MDX from SQL server

P: n/a
Hi ,
What i exacly want to do is

1. Connect to OLAP server from my Sql server using following query
string

'SELECT a.* FROM
OpenRowset(''MSOLAP'',''DATASOURCE="RAPID-CHRISTUS"; Initial
Catalog="MRS";

2. I want to execute my dynamically created MDX query . This query can
be greater than 8000 varchar limit.
When my query length exceeds 8000 length i break it up into 2 parts
..Here I have broken my query into 2 parts

@mdx1 and @mdx2

Now i execute the entire statement as

exec('SELECT a.* FROM
OpenRowset(''MSOLAP'',''DATASOURCE="RAPID-CHRISTUS"; Initial
Catalog="MRS";'',' + @mdx1 + mdx2 ') as ' )

Still error comes that :
Unclosed quotation mark before the character string 'WITH MEMBER ..

('With member' is the starting statement of my MDX query)

Is there any other way to connect to OLAP server and execute an MDX
statement with a Length greater than 8000 chars

TIA

May 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
(ag***********@gmail.com) writes:
Now i execute the entire statement as

exec('SELECT a.* FROM
OpenRowset(''MSOLAP'',''DATASOURCE="RAPID-CHRISTUS"; Initial
Catalog="MRS";'',' + @mdx1 + mdx2 ') as ' )

Still error comes that :
Unclosed quotation mark before the character string 'WITH MEMBER ..

('With member' is the starting statement of my MDX query)

Is there any other way to connect to OLAP server and execute an MDX
statement with a Length greater than 8000 chars


Have a look at http://www.sommarskog.se/dynamic_sql.html#OPENQUERY
for some tips.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.