Data Type Conversion of Excel Source

  • 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.

  • 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.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • 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.

    ----------------------------------------------------

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply