Zane Qureshi
Zane Qureshi

Reputation: 11

ETL | From SQL into Excel using SSIS, Specific Format

I am trying to pull data from SQL into an Excel spreadsheet however, the sheet needs to show the data in a specific format.

I am using functions in SSIS to pull the data onto an excel sheet but I need further transformation to create a specific excel format

This is how I want it to look, EXCEL SPREADSHEET (see screenshot)

see image

Notice the spaces between PRODUCTA and PRODUCTB in the SKU column are BLANK.

I can load the data from SSIS into Excel, but I can not find the functions to transform the excel sheet into this format

Upvotes: 1

Views: 215

Answers (2)

Rodrigo Mendoza
Rodrigo Mendoza

Reputation: 26

Use the data conversion component in ssis toolbox. There change the desired format for each column

Upvotes: 0

Hadi
Hadi

Reputation: 37368

There are two approaches you can go with:

Using a derived column instead of SKU column:

If you have a row_number column (similar to TIER_PRICE shown in the image), you can simply add a derived column with as similar expression:

[TIER_PRICE] != 5 ? NULL(DT_I4) : [TIER_PRICE]

Using a Script Task

After importing data to Excel, you can write a C# Script Task and use a library like Microsoft.Interop.Excel to apply the transformation you need.

Upvotes: 1

Related Questions