Home > Archive > MS SQL Server OLAP > August 2005 > Referencing MDX Query results in SQL Server









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Referencing MDX Query results in SQL Server
rip.murdock

2005-08-31, 8:24 pm

I’ve utilized Openrowset with Select…Into to dump the results of an
MDX query into a new table created on the fly. I’ve attempted to
reference the results using the INFORMATION_SCHEMA.COLUMNS table to
build a dynamic T-SQL statement, T-SQL doesn’t recognize the column
names that are automatically assigned to these columns because they
contain “.” The first four column names are
[Date].[Year].& #91;MEMBER_CAPTION],
[Date].[Quarter].& #91;MEMBER_CAPTION],
[Date].[Month].& #91;MEMBER_CAPTION],
[Date].[Day].[MEMBER_CAPTION]
When selecting the first of these, I get this error message.

The column prefix 'Date.Year' does not match with a table name or
alias name used in the query.

If I enclose the column name in brackets, selecting
[[Date].[Year].& #91;MEMBER_CAPTION]]

I get this error:

Unclosed quotation mark before the character string 'MEMBER_CAPTION]

I could also select these columns by ordinal position, but I do not
believe that is possible in T-SQL.

Any other suggestions?

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com