Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Changing DataFlow Datatype

Author  Topic 

lfernandesfotos
Starting Member

2 Posts

Posted - 2011-06-02 : 14:36:00
Hi!

I was exporting SQL Server data to a csv file, but there was a problem formating NUMERIC dataype data. So, I used the following command, converting numeric data to VARCHAR:

SELECT
REPLACE(convert(varchar,convert(numeric(10,2),qtde_estoque_maximo)),'.',',') qtde_estoque_maximo
,REPLACE(convert(varchar,convert(numeric(10,2),qtde_estoque_maximo_informado)),'.',',') qtde_estoque_maximo_informado
,REPLACE(convert(varchar,convert(numeric(10,2),qtde_estoque_seguranca)),'.',',') qtde_estoque_seguranca
,REPLACE(convert(varchar,convert(numeric(10,2),qtde_estoque_seguranca_informado)),'.',',') qtde_estoque_seguranca_informado
FROM TAB1

The problem is that when I changed the datatype in the query, it has not changed the Datatype in the DataFlow. So, when running the process it throws the error trying to convert DT_STR into DT_Numeric.

I think that changing the datatype in DataFlow properties could solve my problem, but it is Disabled to change.

Can U help me?

===========
Luiz Fernandes
lfernandesfotos@hotmail.com

latch
Yak Posting Veteran

62 Posts

Posted - 2011-06-02 : 16:57:22
Instead of using the query to pull the data from the table can you able to use derived column transformation in a ssis package that would solve the problem.
Go to Top of Page
   

- Advertisement -