SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


here was an error with output column on output "OLE DB Source Output The column status returned was:...


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...

Author
Message
Phillip.Putzback
Phillip.Putzback
SSC-Enthusiastic
SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)

Group: General Forum Members
Points: 113 Visits: 227
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
Tom Van Harpen
Tom Van Harpen
SSC Eights!
SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)

Group: General Forum Members
Points: 882 Visits: 1102
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?
Phillip.Putzback
Phillip.Putzback
SSC-Enthusiastic
SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)

Group: General Forum Members
Points: 113 Visits: 227
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.
Tom Van Harpen
Tom Van Harpen
SSC Eights!
SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)SSC Eights! (882 reputation)

Group: General Forum Members
Points: 882 Visits: 1102
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
Phillip.Putzback
Phillip.Putzback
SSC-Enthusiastic
SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)

Group: General Forum Members
Points: 113 Visits: 227
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search