Remove Double Quotes in Excel Sheet using SSIS

Remove Double Quotes in Excel Sheet using SSIS transformations is the most common question asked by many of our friends and SSIS blog followers. In this article, we will show you how to Remove Double Quotes in Excel Sheet using SSIS with a live example.

The below screenshot will show you the data present in the Customers.xls Excel file. If you observe closely, every row under the Education column surrounded by the double quotes (“”). Let us see the Remove Double Quotes in Excel Sheet using SSIS steps to resolve it

Remove Double Quotes in Excel Sheet using SSIS 1

Remove Double Quotes in Excel sheet using SSIS Example

STEP 1: Drag and drop the data flow task from the toolbox to control flow region

Remove Double Quotes in Excel Sheet using SSIS 2

Double click on it will open the data flow tab.

STEP 2: Drag and drop EXCEL Source, OLE DB Destination from SSIS toolbox to the data flow region.

Remove Double Quotes in Excel Sheet using SSIS 3

STEP 3: Double click on Excel source in the data flow region will open the connection manager settings and provides an option to select the table holding the source data. From the below screenshot, you can see we are choosing the Customers.xls file present in our local hard drive

Remove Double Quotes in Excel Sheet using SSIS 4

Since our excel sheet contains the column names in the first row, we are check-marking the First row has column names option. If your excel file is different, don’t select it.

Remove Double Quotes in Excel Sheet using SSIS 5

From the below screenshot, we are selecting the Customer tab sheet from Customers.xls excel file.

Remove Double Quotes in Excel Sheet using SSIS 5

STEP 5: Click on the columns tab to verify the columns. In this tab, we can uncheck the unwanted columns.

Remove Double Quotes in Excel Sheet using SSIS 7

Click OK and drag and drop the Derived Column Transformation from the toolbox to the data flow region. Next, connect the excel source output to this.

STEP 5: Double click or right-click on the Derived Column Transformation to edit and convert our source columns data.

Remove Double Quotes in Excel Sheet using SSIS 8

In the Derived Column Transformation editor, we were adding the new column as New Education and added the expression to it.

LTRIM(RTRIM(REPLACE(Education,"\"","")))
Remove Double Quotes in Excel Sheet using SSIS 9

If you observe the Expression code, We used the LTRIM and RTRIM to remove the extra spaces and REPLACE function to replace the double quotes.

STEP 7: Next, provide the Server, database, and table details of the target. So double-click on the OLE DB Destination and provide the required information.

Here, we are creating a new table

Remove Double Quotes in Excel Sheet using SSIS 10

NOTE: It is always necessary to convert data types during the transfer from Excel to SQL server database in SSIS. Here, we are creating a table with NVARCHAR data types, but in real-time, scenarios will be different.

Remove Double Quotes in Excel Sheet using SSIS 11

STEP 8: Click on the Mappings tab to check whether the source columns exactly mapped to the destination columns.

Remove Double Quotes in Excel Sheet using SSIS 12

Click OK to finish our package design. Let us run the package and see whether we successfully remove Double Quotes in Excel Sheet using SSIS or not

Remove Double Quotes in Excel Sheet using SSIS 13

Let us open the SQL Server Management studio and Check the results

Remove Double Quotes in Excel Sheet using SSIS 14

Comments are closed.