[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


connection manager in SSIS

Posted on 2011-04-27
Medium Priority
Last Modified: 2013-11-18
I'm creating an SSIS package in Business Intelligence  Studio which  takes a csv file and loads it into a database table.
The csv file is dumped on a network share on a weekly basis.
I want to schedule a job that automatically runs an SSIS package that loads this file into the database.

The problem is that the name of the file changes on a weekly basis

Is it possible to  create a Connection Manager that can accomodate these file name changes?
Question by:blossompark
  • 2
LVL 21

Accepted Solution

Alpesh Patel earned 1000 total points
ID: 35473833
Create File Connection runtime using Expression.

"\\\\" +  @[User::FILE_SHARE] + TRIM(@[User::Done]) + LTRIM(@[User::FileName]) + (DT_WSTR,4)YEAR(GETDATE()) + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2) +  RIGHT("0" + (DT_WSTR,2)DAY( GETDATE()), 2) +   ".txt"
LVL 15

Assisted Solution

AmmarR earned 1000 total points
ID: 35473854
if all the files are in one directory

you can loop through all files in the directory and copy them to sql using Foreach Loop Container

LVL 15

Assisted Solution

AmmarR earned 1000 total points
ID: 35473882
here is another useful article

Using SQL Server Configurations to configure Flat File Connection Manager


Author Closing Comment

ID: 35474194
Hi PatelAlpesh  and  AmmarR, thanks for your responses...that gives me plenty to work with...Thanks again :-)

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

872 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