Using SQL command inside DFT

  • Hi,

    I'm trying to re-populate a sql table thru a DFT, which should be very simple, however it keeps failing with error "no column information was returned by the SQL command"

    Here's the sequence I'm following.
    1. truncate the sql table (aggregated at unit # level). success
    2. Data Flow Task with a flat file source that points to unit # detail level data as the source. Then in OLE DB destination I'm pasting a sql command w/the code below. Parsing the query passes, after that I get the error when I try to save the DFT.

    insert    into dbo.unit_forecast_52wk_rollup

    Select    UnitNo, SUM(CAST(QUANTITY AS DECIMAL(12,2))) as QTY_52WKS
    FROM   DATABASE.DBO.unit_forecast_detail
    GROUP    BY UnitNo

  • I'm not sure you understand what an OLE DB Destination is supposed to do.   It's job is to INSERT the rows that flow from the previous element, and if you supply a query, you're really only supposed to assign a given column in the existing rowset to a given destination column.   You don't even need a query for that.   However, given that you supplied one, you appear to be assuming some other functionality.   Do you want to perform this insert and then do that group by query and get the results somewhere else?   Please be a lot more detailed about what, exactly, you want, and why you thought you should supply a query for an OLE DB Destination...

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • I figured it out.

    I needed to set the data type for column being summed as decimal in the flat file connection manager because the QUANTITY column in the flat file was coming in as text. Then, inside the DFT; add a flat file source which points to the flat file connection; then add an aggregate task that summed the QUANTITY at the unit level; and finally pass the aggregated results to an LE DB destination that updates the sql table and VOILA!! FIXED!!

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

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