Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Data Type Conversion of Excel Source Expand / Collapse
Author
Message
Posted Monday, January 21, 2013 12:11 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, September 19, 2013 4:30 AM
Points: 78, Visits: 195
I would like to import an excel sheet to a DB table which is having around 100 columns having data type varchar.
However as we know that by default excel source take unicode data type for these columns which ends in conversion error while importing to table.

Is there a way except advanced editor to change the data type of all columns of excel source in one shot instead of doing for every columns one by one manually fron advanced editor.

Post #1409368
Posted Monday, January 21, 2013 2:31 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 5:39 AM
Points: 13,252, Visits: 10,134
It might be easier to change the datatypes in the destination table.

You can also use the data conversion component. It's still manual, but at least you have a checkbox to select all the columns. 100 columns would take me 2 or 3 minutes.

Or you could write the data to a staging table having all unicode columns, and then transfer the data to the final destination table.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1409435
Posted Wednesday, March 27, 2013 11:21 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 6:23 PM
Points: 312, Visits: 816

Is there a way except advanced editor to change the data type of all columns of excel source in one shot instead of doing for every columns one by one manually fron advanced editor.


You mention advanced editor. Are you using a flat file connection to point to the Excel file? I am wondering if this is actually a csv file that you opened with Excel. If so in the advanced editor you can select all the columns at once by using shift and the down arrow. then in the right pane change the data type to dt_str and it does it for all. If it is in Excel then I don't know any other way aside from the data conversion transformation.
Post #1436059
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse