SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Skip Header Rows in Excel and Concatenate Excel column names in SSIS


Skip Header Rows in Excel and Concatenate Excel column names in SSIS

Author
Message
Learning1
Learning1
SSC Journeyman
SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)

Group: General Forum Members
Points: 86 Visits: 94
Hi,

I am trying to load data from an excel sheet to a sql server table. The first two rows in excel has the page header. I have to concatenate columns from two rows to define a new destination column. Attached screenshot shows the sample source and sample destination. I know how to skip rows of the page header by changing the OpenRowSet value in the Excel connection Manager properties, but I don't know how to concatenate two row values to get the new column name. Can anyone please help me how to do this?

Thanks in advance.
Attachments
Data.jpg (30 views, 51.00 KB)
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27619 Visits: 13268
I would read the head as it were data and concatenate the values in a script component.

One question though: why do you need to fiddle around with the header when you are importing to a SQL Server table?


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

MCSE Business Intelligence - Microsoft Data Platform MVP
Learning1
Learning1
SSC Journeyman
SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)

Group: General Forum Members
Points: 86 Visits: 94
Koen Verbeeck (12/17/2013)
I would read the head as it were data and concatenate the values in a script component.

One question though: why do you need to fiddle around with the header when you are importing to a SQL Server table?


Koen,

Thanks for your reply. We are not doing anything with header in the sql table, we just ignore the header part. All we are trying to do is deriving a column with values from different cells.
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18726 Visits: 20451
Sounds like you need an asynchronous script component.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18726 Visits: 20451
Phil Parkin (12/18/2013)
Sounds like you need an asynchronous script component.


But why do you care what the column name is?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27619 Visits: 13268
Phil Parkin (12/18/2013)
Phil Parkin (12/18/2013)
Sounds like you need an asynchronous script component.


But why do you care what the column name is?


Are you talking to yourself now? :-)


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

MCSE Business Intelligence - Microsoft Data Platform MVP
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18726 Visits: 20451
Koen Verbeeck (12/18/2013)
Phil Parkin (12/18/2013)
Phil Parkin (12/18/2013)
Sounds like you need an asynchronous script component.


But why do you care what the column name is?


Are you talking to yourself now? :-)


I get a better response rate if I do :-P


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Learning1
Learning1
SSC Journeyman
SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)

Group: General Forum Members
Points: 86 Visits: 94
Phil Parkin (12/18/2013)
Phil Parkin (12/18/2013)
Sounds like you need an asynchronous script component.


But why do you care what the column name is?


Thanks for your reply Phil. Unfortunately, the destination table is designed such that the column names should be combination of the names from Row 3 and Row 4.
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18726 Visits: 20451
chaseurpuli (12/18/2013)
Phil Parkin (12/18/2013)
Phil Parkin (12/18/2013)
Sounds like you need an asynchronous script component.


But why do you care what the column name is?


Thanks for your reply Phil. Unfortunately, the destination table is designed such that the column names should be combination of the names from Row 3 and Row 4.


You could map a source column called 'chicken' to a destination column called 'squirrel' with no issues at all: column names do not have to match.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27619 Visits: 13268
Phil Parkin (12/19/2013)
chaseurpuli (12/18/2013)
Phil Parkin (12/18/2013)
Phil Parkin (12/18/2013)
Sounds like you need an asynchronous script component.


But why do you care what the column name is?


Thanks for your reply Phil. Unfortunately, the destination table is designed such that the column names should be combination of the names from Row 3 and Row 4.


You could map a source column called 'chicken' to a destination column called 'squirrel' with no issues at all: column names do not have to match.


+1

It doesn't help for maintainability, but it is not necessary to map columns with unique names.


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

MCSE Business Intelligence - Microsoft Data Platform MVP
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