Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Data Type Conversion of Excel Source


Data Type Conversion of Excel Source

Author
Message
rhythm.varshney
rhythm.varshney
SSC Journeyman
SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)

Group: General Forum Members
Points: 88 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.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16469 Visits: 13207
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
MMartin1
MMartin1
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1120 Visits: 2015

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.

----------------------------------------------------
How to post forum questions to get the best help
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search