here was an error with output column on output "OLE DB Source Output The column status returned was: "The value could not be converted because of a potential loss of data."

  • I have stored procedure that creates a dynamic SQL command to run another stored procedure that has a column INV_STATUS.

    In the internal procedure I cast that column as Numeric, I've tried leaving as INT because that is what the source is and I've tried casting it as varchar

    In my Wrapper procedure I created a Contract so SSIS can pickup the METADATA and have tried all three data type, with the last being the numeric.

    ,[INV_STATUS]=CAST(NULL AS NUMERIC)

    When I run the procedure in SSMS I see the value 6 in every row, when I preview it in the OLE Source in SSIS I see a 6 in every row when I copy the data from SSMS results into excel I see the 6, but when I run it in SSIS I get a 0 in my data viewer when mapping the errors to a row counter.

    Error Code -1071607694

    Error Column - 431

    Error Desc - The data value cannot be converted for reasons other than sign mismatch or data overflow.

    The column 431 in the Advanced editor shows as numeric also.

    The real odd thing is this worked the other day with 12 years of data

    Today I can run it for a month.

    Thanks,

    Phil

  • Phillip.Putzback (10/18/2013)


    I have stored procedure that creates a dynamic SQL command to run another stored procedure that has a column INV_STATUS.

    In the internal procedure I cast that column as Numeric, I've tried leaving as INT because that is what the source is and I've tried casting it as varchar

    In my Wrapper procedure I created a Contract so SSIS can pickup the METADATA and have tried all three data type, with the last being the numeric.

    ,[INV_STATUS]=CAST(NULL AS NUMERIC)

    When I run the procedure in SSMS I see the value 6 in every row, when I preview it in the OLE Source in SSIS I see a 6 in every row when I copy the data from SSMS results into excel I see the 6, but when I run it in SSIS I get a 0 in my data viewer when mapping the errors to a row counter.

    Error Code -1071607694

    Error Column - 431

    Error Desc - The data value cannot be converted for reasons other than sign mismatch or data overflow.

    The column 431 in the Advanced editor shows as numeric also.

    The real odd thing is this worked the other day with 12 years of data

    Today I can run it for a month.

    Please explain a couple things,

    Frist - In my Wrapper procedure I created a Contract so SSIS can pickup the METADATA - SSIS is going to be looking at source columns and getting metadata from there. How are you implementing a "contract"?

    Second - what are you running in your OLE Src component? is it the dynamic procedure coded as "Exec dbo.myproc" ?

    Also what are you "previewing" in the OLE Src and how does that differ between design time and run time?

  • The contract is based on this post. I have used the wacky code in all my procs that use temp tables or dynamic sql so the source can get the meta data for the columns.

    http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/65112/

    Then I hard code a small date range of 5-1-2001, 5001-1-2001 for the parameters and then I can preview.

    inside the dynamic procedure I build the SQL statement with the typical

    Set @strSql = @strSQL + 'exec myproc'

    Set @strSql = @strSQL + parameter values

    Then at the end of the proc

    EXEC (@strSQL)

    i finally figured out my problem. My contract was missing a couple columns that were coming back in the results. So one of the columns that was not an integer fell in the order of one of the integer columns.

  • That is pretty interesting, I've never run into a situation where I had to do that uh well sort of.

    I've used dynamically built statements within SSIS and used via an expression or variable, but I've always coded a working statement with "WHERE 1=2" either in the variable or directly in the sql command parameter which just gets overwritten at runtime.

    Thanks for posting that, learned something new today and glad you found your answer!

    Tom

  • FYI, My contract, is what I'm guessing is what you call a working statement is inside the If 1=2 statement at the top of my proc.

Viewing 5 posts - 1 through 4 (of 4 total)

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