SSAS DSV Incorrect syntax near ')' + CTE is not allowed in SSAS DSV and its Solution

CTE is not allowed in SSAS DSV . it will give the error
Incorrect syntax near ')'

To avoid this error Please use Named Query instead of CTE.

Example :



WITH mycte AS (SELECT TOP (200) object_id, name, column_id,
        system_type_id
        FROM sys.columns)
        select [CTETest].*
        from
        (
        SELECT object_id, name, column_id, system_type_id
        FROM mycte as mycte_1
        ) AS [CTETest]

You can use

Select Object_id , column_id , system_type_id
FROM (SELECT TOP (200) object_id, name, column_id,
        system_type_id
        FROM sys.columns) myCTE

Comments

Popular posts from this blog

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces