Duplicate column names using SQL Server - OPENQUERY
Posted: Fri Sep 12, 2008 7:24 am
Hi there,
I am wondering if anyone ever tries querying TM1 data from MS SQL Server (SSMS) using OPENQUERY. We have TM1 cubes and are planning to use TM1 writeback abilities to help with some modelling and forecasting. Once users finish forecasting their data, we would like to create reports using MS SQL Server Reporting Services as most of our data stored on SQL Server database.
Anyway, what I am testing is just querying TM1 data from SSMS. I know that my MDX is correct and it works as I can get the result back when I tested it with MDXSample.exe, which comes with SQL Server 2000, see attached image. It also works in the MS SQL Server Reporting Services (SSRS) but show duplicate column names, see attached image. When I do the query from SSMS using OPENQUERY, I receive an error:
Msg 492, Level 16, State 1, Line 1
Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name "[measuresCapex].[Invoice Amount][Version].[All Version^ACT].[Months].[All Months^Mar]." is a duplicate.
My query is as following:
select *
from openquery(tm1dev13, '
select
CROSSJOIN (
CROSSJOIN(
{[measuresCapex].[Invoice Amount],[measuresCapex].[Monthly Budget Amount]}
,{[Version].[Actual],[Version].[Budget]}
)
,{[Months].[Mar],[Months].[Mar YTD]}
)
on columns,
(CROSSJOIN(
{TM1FILTERBYLEVEL({TM1SUBSETALL([dimState])},0)}
,{[Job Code].[All Capex Types].children}
))on rows
from [Capex Register]
WHERE ([Years].[2008],[FX].[AUD])
')
Please could you let me know if this is a bug and whether there is a HotFix for it. It looks like with OPENQUERY and SSRS, the result is returned as recordset and somehow the column names cannot be shown correctly; perhaps, due to limitation to number of characters that can be shown in the column name of SSMS? But I also wrote a query against Analysis Services cube using CROSSJOIN on columns and getting result back without any problem with duplicate column names.
Cheers,
Nat
I am wondering if anyone ever tries querying TM1 data from MS SQL Server (SSMS) using OPENQUERY. We have TM1 cubes and are planning to use TM1 writeback abilities to help with some modelling and forecasting. Once users finish forecasting their data, we would like to create reports using MS SQL Server Reporting Services as most of our data stored on SQL Server database.
Anyway, what I am testing is just querying TM1 data from SSMS. I know that my MDX is correct and it works as I can get the result back when I tested it with MDXSample.exe, which comes with SQL Server 2000, see attached image. It also works in the MS SQL Server Reporting Services (SSRS) but show duplicate column names, see attached image. When I do the query from SSMS using OPENQUERY, I receive an error:
Msg 492, Level 16, State 1, Line 1
Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name "[measuresCapex].[Invoice Amount][Version].[All Version^ACT].[Months].[All Months^Mar]." is a duplicate.
My query is as following:
select *
from openquery(tm1dev13, '
select
CROSSJOIN (
CROSSJOIN(
{[measuresCapex].[Invoice Amount],[measuresCapex].[Monthly Budget Amount]}
,{[Version].[Actual],[Version].[Budget]}
)
,{[Months].[Mar],[Months].[Mar YTD]}
)
on columns,
(CROSSJOIN(
{TM1FILTERBYLEVEL({TM1SUBSETALL([dimState])},0)}
,{[Job Code].[All Capex Types].children}
))on rows
from [Capex Register]
WHERE ([Years].[2008],[FX].[AUD])
')
Please could you let me know if this is a bug and whether there is a HotFix for it. It looks like with OPENQUERY and SSRS, the result is returned as recordset and somehow the column names cannot be shown correctly; perhaps, due to limitation to number of characters that can be shown in the column name of SSMS? But I also wrote a query against Analysis Services cube using CROSSJOIN on columns and getting result back without any problem with duplicate column names.
Cheers,
Nat