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)
 Auto truncate varchar columns from excel source

Author  Topic 

saran_d28
Starting Member

36 Posts

Posted - 2012-08-29 : 08:03:15
I have a data flow task. which contains the following steps.
1) Excel source
2) OLEDB Destination ( Points to SQL Server)

Sample Excel data

abcd efgh ijkl
qwer rtue xyzw

SQl Server table structure is
c1 varchar(2)
c2 varchar(2)
c3 varchar(1)

I want a ouptut of my table is

ab ef i
qw rt x

(ie) The additional charactes in the source should be truncated.
Can we achive this without Derived column task.

In DTS 2000 the characters are truncated automatically. How can we achive this using SSIS

Please help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-29 : 13:11:16
you need to write an expression for each column using a dervived column transform inside your data flow task for that. you can use LEFT function in SSIS for this.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -