SSIS: How to loop through multiple flat files as data sources
- Category: SQL Server Integration Services
- Hits: 37054
This is an article to demonstrate a quick step-by-step on having an SSIS package loop through a directory/folder of files in order to populate a database table. We could add each file as a separate connection manager but this is inefficient and not versatile enough to accommodate files that get added later.
Why?
I am creating an extract SSIS package intended to take a text file as its source and to populate a database table with this data. Note that this only works if all the text files to be used as source data have the same number of columns and where the column widths match.
How?
I've adapted my real working product with an example. As my work was for a Personnel/HR project, and data confidentiality is somewhat important, some of the images will be censored or data changed in the example below.
SSIS Multiple Lookups in one
- Category: SQL Server Integration Services
- Hits: 27762
A quick article on an alternative to multiple lookups in SSIS. For any SSIS developer trying to create packages that need to decode a number of values into their full name/description (eg. "M" to "Male", "Prof" to "Professor").
Why?
Our extract phase in the SSIS package takes data from a source database and puts it in staging in the exact form it came through. Our transform package will convert the data and output it to the target system. For our package to decode what "M" means, it needs to look this up in a table on the original server. We had around 12 lookups to do, so you could do this:

How?
SSRS External Images don't display
- Category: SQL Server Reporting Services
- Hits: 83512
We want some photos taken from another website of ours to display in our report. These are not stored locally on the Reporting Server because other services use these photos on our Intranet and we only want one location to upload the photos. These images are provided via a website address (http) or network share (file).
Before you ask, we have several MS Sharepoint sites but we didn't go down the route of uploading 10000+ images into a Sharepoint database though we are still considering it; so this article is more about just getting external images to display when they are provided over an authenticated URL (You shouldn't be having any issues with this if the image is available to anonymous users - eg. Google Logo).
Our Setup
- Windows XP Workstation
- Business Intelligence Development Studio 2008 (BIDS)
- SQL Server 2008 R2 Reporting Server (SSRS) running on Windows Server 2003
- Team Foundation Server 2010 (TFS)
Problem #1: Image does not appear within SSRS
When previewing the report in BIDS, the photo appears fine. If we deploy the report to our Reporting Server and attempt to view it using a Web-Browser, the image does not display:
- Get report to see images hosted on an external URL
- Check if image exists to display alternative placeholding image.
SSRS Zero Padding
- Category: SQL Server Reporting Services
- Hits: 214604
I didn't want to do this at the database level, mainly because it meant modifying the SQL query. The zero padding would need to be applicable within an MDX query.
The Situation
We have a database using Oracle 10g, and a SQL Server Reporting Services v2008 R2 environment. My use for this was when displaying an audit log displaying the oracle errors.
Oracle Errors
An Oracle error usually returns in the format of -12345. If we want to look them up the error is ORA-12345. Unfortunately Oracle also returns errors of less than 10000 so ORA-00201 would actually be returned as "-201". As I wanted a link so that the user can just click on this link and it would take them to http://ora-00201.ora-code.com/.
SSRS Report Builder 2.0 - Error during processing
- Category: SQL Server Reporting Services
- Hits: 19591
The Issue
After modifying a report and on running it, Report Builder 2.0 returns the following error:
An error occurred during local report processing.
An error has occurred during report processing.
Query execution failed for dataset 'DataSet1'.
The variable name '@GroupName' has already been declared. Variable names must be unique within a query batch or stored procedure.
If Then Else in Report Builder 2.0 Expressions
- Category: SQL Server Reporting Services
- Hits: 44198
Yes, well don't laugh, I could not find this on the WWW so I was obviously not using Google properly. Anyway here's just a quick note on how to do if else statements in Report Builder 2.0
I'm looking at the following if statement:
If (MyFieldName = 0) Then Return 1 Else Return MyFieldName
Can be expressed as:
IIf(Fields!MyFieldName.Value = 0, 1, Fields!MyFieldName.Value)
Report Builder 2.0 - Hide Series1
- Category: SQL Server Reporting Services
- Hits: 23027
- SQL Server 2008
- Report Builder 2.0
- BMC Service Desk Express 9.8
- Incident #
- Group Name
- Close Date & Time
- Assigned to Full Name
- Incident Type
Change Regional Settings for your Report
- Category: SQL Server Reporting Services
- Hits: 31263
Basically I thought that the regional settings of a report generated using Report Builder 2.0 on a MS SQL Server 2008 instance were dependent on either the server or the client machine. Realised that this was actually specified in the report. Here's a quick note on how to set Dates and Times used in parameter fields to UK format (dd/MM/yyyy).
Page 4 of 12
Credit where Credit is Due:
Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.
Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.
Thank you for visiting and, as always, we hope this website was of some use to you!
Kind Regards,
Joel Lipman
www.joellipman.com
Latest Articles
Accreditation



Donate & Support


