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


DBTYPE_STR to DBTYPE_NUMERIC Conversion Errors...Need Help!


DBTYPE_STR to DBTYPE_NUMERIC Conversion Errors...Need Help!

Author
Message
gregory.perry2
gregory.perry2
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 84
Hello Forum,
I have a file that I'm getting from some mainframe system that is a .csv format. I'm trying to import this file into my SQL Server data table and the values that are in this specific file is coming to me as a string. However the values are supposed to be Numeric (Double) to be exact.

Does any one know of a way to convert the data field in the DTS Transform Data Task for 2000 from a DBTYPE_String to a DBTYPE_Numeric?

I was trying to use a vbscripting task to do this, but I'm open to any suggestions at this point.

Thanks for any help,

Greg
gregory.perry2
gregory.perry2
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 84
Ok, I figured out what was wrong with this for anyone readers that might be interested.

First of all, the data file that I received was from Excel and had the two offending columns formatted as currency. So apparently Excel saves these Currency columns with conditional formatting that SQL Server DTS does not like...ie: "$1,000.00" In this string field SQL Server was complaining about the $ and the , that was in that string. Also if there is a null value it puts "#Null" in the field. All of these things create problems I think for DTS to transform a string to a double data type.

I resolved by going to the source and explaining to them that they need to save their spreadsheet as a general format and not use any special formatting for display purposes before sending this file to me. I could have also opened the file myself and reformatted the spreadsheet as general before importing it into SQL 2000 using DTS.

I hope this my help another newby that experiences something similar trying to use a DataTransformation

Until next time...GregCool
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