x
login about faq Site discussion (meta-askssc)

SSIS Excel fields into variables and populate them into one row in database

I have a Excel file which I need to load each field into a single row in a database table. the fields are located like C3:C3, E2:E2, F7:F7 etc. you get the idea. How do I save the values in each field into variables and insert them into a single row? Please help.

Thanks

more ▼

asked Apr 27 '11 at 03:29 PM in Default

ryanwei88 gravatar image

ryanwei88
10 1 1 1

(comments are locked)
10|1200 characters needed characters left

3 answers: sort newest

thank you very much for helping me out. I also feel Script Component will do the trick. But how do I get value from Excel into the variable? a sample code will be helpful.

Thanks

more ▼

answered Apr 29 '11 at 01:58 PM

ryanwei88 gravatar image

ryanwei88
10 1 1 1

Apr 29 '11 at 02:28 PM ryanwei88
(comments are locked)
10|1200 characters needed characters left

DFT task which has:

Excel Source:To read the excel Script Component: assign values to the varaiables Oledb Destination: Dynamically form the sql query using the variable value.

more ▼

answered Apr 28 '11 at 12:01 AM

aRookieBIdev gravatar image

aRookieBIdev
2.1k 25 43 48

(comments are locked)
10|1200 characters needed characters left

One possible solution that I see is by using VSTO (Visual Studio Tools for Office) from a Script Component in the Data Flow. That of course means that you'll need to write some .NET code to retrieve the values from Excel, then output them on the output fields that you need to define in the Script Component.

more ▼

answered Apr 27 '11 at 11:49 PM

Valentino Vranken gravatar image

Valentino Vranken
1.5k 2 7

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x758
x98

asked: Apr 27 '11 at 03:29 PM

Seen: 1337 times

Last Updated: Apr 27 '11 at 03:29 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.