April 11, 2011 at 10:39 am
Loading data from flat file to Sql table. I have a column X in table that needs to be updated with time stamp ( this column cannot be mapped from flat file, as it doesn't contain any kind of date column)...
Making sure that, I add a column to the flat file data type as Dt_DBTIME ( through Flat file SHOW ADVANCED EDITOR) and then using a Derived column transformation task, updating it with getdate time function ...but when i do this i get an error for this column as :
Data conversion failed. The data conversion for column "Column X" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
Saw some online forums which explains this, but couldn't follow it... can anyone help me
April 12, 2011 at 4:13 am
quillis131 (4/11/2011)
Loading data from flat file to Sql table. I have a column X in table that needs to be updated with time stamp ( this column cannot be mapped from flat file, as it doesn't contain any kind of date column)...Making sure that, I add a column to the flat file data type as Dt_DBTIME ( through Flat file SHOW ADVANCED EDITOR) and then using a Derived column transformation task, updating it with getdate time function ...but when i do this i get an error for this column as :
Data conversion failed. The data conversion for column "Column X" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
Saw some online forums which explains this, but couldn't follow it... can anyone help me
Hey,
Why you are playing with Flat file. If you need to add 'Column X' (with value as current date) to your flat file source output, you can do it by simply following these steps:
1) Create a source adapter to flat file & connect it with your source file.
2) Drag n drop a derived column transformation to your data flow surface. Drop flat file source data pipeline (green one) to this derived column.
3) Open derived column transformation editor. Give 'Derived Column Name' = 'Column X' , In 'Derived Column' drop down chose option '<add as new column>' and then in expression write 'GETDATE()' (or any value that you wanna give to it)
4) Connect derived column transformation output to your database destination.
It's simple and will work perfectly.
__________________________________________
---------------------------------------------------
Save our mother Earth. Go Green !!!
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply