Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

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... Expand / Collapse
Author
Message
Posted Friday, October 18, 2013 8:53 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 11:04 AM
Points: 37, Visits: 144
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
Post #1506205
Posted Monday, October 21, 2013 11:34 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, April 10, 2014 4:26 PM
Points: 400, Visits: 946
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?
Post #1506772
Posted Tuesday, October 22, 2013 6:21 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 11:04 AM
Points: 37, Visits: 144
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.
Post #1507434
Posted Wednesday, October 23, 2013 8:28 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, April 10, 2014 4:26 PM
Points: 400, Visits: 946
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
Post #1507669
Posted Wednesday, October 23, 2013 10:09 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 11:04 AM
Points: 37, Visits: 144
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.
Post #1507725
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse