dbTalk Databases Forums  

Data import issue

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Data import issue in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brett Martin
 
Posts: n/a

Default Data import issue - 05-17-2005 , 04:48 AM






I am importing data into a decimal field using sql 2000 dts. The issue I
have is that if the first row of data is an integer and shows no decimal
point or places (as this system seems to), sql then treats all subsequent
rows as integers even if they do have decimals. There does not seem to be
any way round this on the system I am exporting from.

Does anyone know a way of making this work on a dts import?

Thanks

Brett.


Reply With Quote
  #2  
Old   
Chandra
 
Posts: n/a

Default RE: Data import issue - 05-17-2005 , 05:52 AM






Hi
Force it to place as a decimal in the DTS package. Use the Query option and
write the query as CAST (<column name>, number(5,2))

hope this will solve your purpose


--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---------------------------------------



"Brett Martin" wrote:

Quote:
I am importing data into a decimal field using sql 2000 dts. The issue I
have is that if the first row of data is an integer and shows no decimal
point or places (as this system seems to), sql then treats all subsequent
rows as integers even if they do have decimals. There does not seem to be
any way round this on the system I am exporting from.

Does anyone know a way of making this work on a dts import?

Thanks

Brett.


Reply With Quote
  #3  
Old   
Brett Martin
 
Posts: n/a

Default RE: Data import issue - 05-17-2005 , 08:21 AM



Thanks for the reply, but I am a novice in this area and I am not really sure
what you mean, on transform data task properties, I have selected sql query,
then pressed build query and entered the following, which gives me an
undefined function 'Cast' error.

SELECT {fn cast(ToInvGBPValue as decimal(10,2))}
FROM `orders.txt`

The following works in query builder:

use cfs
select cast(ToInvGBPValue as decimal(10,2))
from orders

Thanks

Brett.

"Chandra" wrote:

Quote:
Hi
Force it to place as a decimal in the DTS package. Use the Query option and
write the query as CAST (<column name>, number(5,2))

hope this will solve your purpose


--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---------------------------------------



"Brett Martin" wrote:

I am importing data into a decimal field using sql 2000 dts. The issue I
have is that if the first row of data is an integer and shows no decimal
point or places (as this system seems to), sql then treats all subsequent
rows as integers even if they do have decimals. There does not seem to be
any way round this on the system I am exporting from.

Does anyone know a way of making this work on a dts import?

Thanks

Brett.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.