all groups > sql server dts > july 2007 >
You're in the

sql server dts

group:

Data conversion with DTS package


Data conversion with DTS package Han
7/16/2007 2:00:04 PM
sql server dts:
Hi,

I try to import a text file into sql server table which has combination of
string, int, float, datetime fields. Some how I keep getting error with data
conversion from String to Int, String to Float, String to DateTime fields.
How can I overcome this problem? I though SQL handles this by itself?

If I have to manually edit transformation script in SQL Enterprise Manager,
what syntax should I use to convert Strint to Int, String to Float, String to
DateTime format?

Anyone experience this problem before? Thanks a lot for your help in advance

Re: Data conversion with DTS package Allan Mitchell
7/17/2007 6:36:21 AM
Hello Han,

This is a quite common problem. Using an Active Script transform you can
use

Cint()
CDate()
CDbl()

and the like functions to do some conversions for you

also have a look here

http://www.sqldts.com/249.aspx

DTS Does some manipulations behind the scenes but not always as you have
seen. When you move on to SSIS you will see that it is even less inclined
to do implicit conversion.




--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button