SolvedPrivate

Querying EXCEL  using  Excel Source Data Flow Task in SSIS 2008

Posted on 2013-01-11
2
42 Views
Last Modified: 2016-02-10
Hi,
I am using an excel source data flow task in SSIS to load specific tabs from spreadsheets into a database.
This works fine as long as the tab exists, as shown using the Preview option below.
if-exists-1.bmp
However there are situations where the tab may not exist and then I want to perform another action.
I am trying to incorporate an IF EXISTS  statement into my query but am  having issues with this, see below
if-exists-2.bmp
any guidance appreciated, thanks
0
Comment
Question by:blossompark
2 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 38766918
Unless there's a metadata table which can be queried (such as sys.tables in a SQL Server DB), I really doubt that you can get this to work by just using that Excel Source.  You'll probably have to use some additional components such as a Script Component.

Or, another option is using the Foreach Loop Container with the Foreach ADO.NET Schema Rowset enumerator to loop over the sheets.

Have a look at this MSDN page for the steps to follow: How to: Loop through Excel Files and Tables by Using a Foreach Loop Container

The chapter you'll be interested in starts halfway down the page.
0
 

Author Closing Comment

by:blossompark
ID: 38767090
Hi ValentinoV,
Thanks for your input.
Yes I think I will have to go down the direction you have pointed to. thanks again
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now