Alias not recognized in PP query

Answered Alias not recognized in PP query

  • Friday, February 15, 2013 2:35 PM
     
     

    Hi All,

    I am using a native SQL Server connection with Excel PowerPivot and in some cases it throws an error related to aliases (below).  The issue is that the query does have aliases and will run fine if run right on the box.

    This is only an intermittent problem, most times it reads the query fine.

    Here is the query that most recently gave me trouble:

    select *

    from FactPurchase f

    left outer join DimEvent e on f.eventid = e.eventid

    where e.eventid is null

    Error is:  The SQL statement is not valid because it contains the following duplicate column names:  EventID.  Correct the statement by prodiving aliases for the columns.


All Replies

  • Friday, February 15, 2013 3:26 PM
     
     Answered

    Hi,

    My DBA solved this for me ...  all I needed to do was add the alias to the select * ... so

    select f.*

    from FactPurchase f

    left outer join DimEvent e on f.eventid = e.eventid

    where e.eventid is null

    Doh


    • Marked As Answer by GudOne Friday, February 15, 2013 3:26 PM
    •