SolvedPrivate

Querying EXCEL  using  Excel Source Data Flow Task in SSIS 2008

Posted on 2013-01-11
2
43 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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.

863 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

25 Experts available now in Live!

Get 1:1 Help Now