CTE woe/weirdness with OLD DB Source

  • I've created a view which uses a CTE to partition on CentreID and order by AddressID. In essence I need just the "top" email address for each Centre. When I run the view in SSMS I get the same result e.g.

    SELECT * FROM MyView WHERE RowNumber = 1

    CentreIDEmailAddress

    23test@email.com

    45 anotheremail@email.com

    However when I run it in through an OLEDB source in a DFT in SSIS I get all sorts of different results. The above query sometimes returns the above but on other occasions it will return RowNumber 2 for CentreID 23

    For example

    CentreIDEmailAddress

    23test2@email.com

    45 anotheremai2l@email.com

    As I said, it runs as expected all the time in SSMS so I am wondering if it related to how SSIS handles CTEs

    Using BIDS 2008 and SQL Server 2008 R2

  • Is it possible to post the CTE itself?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply