all groups > sql server dts > august 2007 >
You're in the

sql server dts

group:

Questions concerning SSIS and VB.NET


Questions concerning SSIS and VB.NET Bob Worley
8/30/2007 12:20:45 PM
sql server dts:
First, let me quickly say that, so far, this is the best, most concentrated
site I have found with worthwhile information concerning SSIS. Kudos to all
who have contributed.
My questions: I'm still trying to get up to speed with SSIS. (I liked DTS,
cautious of SSIS) In my situation, I have a folder that I need to monitor
for the deposit of .xls files containing data. Once, all these files are
present during a month, I need to import the data into separate SQL tables
along with some calculated data. In addition, some of the data I need to
cross reference with an existing SQL table to convert a product descr to a
product code...so, there is some data manipulation occurring. Originally, I
had set this up with a ForEach loop and had separate DataFlow tasks to
process each .xls file...this was working sometimes, and sometimes I was
getting security errors which made me uncomfortable with relying totally on
SSIS to accomplish this. So, I put together a quick VB.NET app to not only
monitor the folder for the .xls files, but to also put in some reporting,
and to send daily email notifications on the status of the files. Along
with this, I created separate SSIS packages for the processing of each .xls
file. I now want to launch these packages from my VB.NET app. Currently, I
am launching these via the Public Shell function passing it a string to run
the .dtsx package from a command line (btw, the packages are stored in a
File System). Is this a poor way to do this? Are there any documents with
examples showing how to perform a function like this properly? As a side
question...when I ran this via the ForEach loop, I couldn't figure out how
to make the package stop when execution completed, is this a parameter
setting? I also found an SSIS example on the internet where they had a VS
project contain both the VB code pages and the SSIS packages...is that a
Re: Questions concerning SSIS and VB.NET jhofmeyr NO[at]SPAM googlemail.com
8/31/2007 7:53:16 AM
[quoted text, click to view]

Hi Bob,

Check out http://www.codeproject.com/useritems/CallSSISFromCSharp.asp
for an example of how to execute SSIS packages through code (OK in the
example it's C# code, but should be pretty easy to port to VB.NET :) )

Regarding the ForEach loop - did you configure this to use the files
in the monitored directory to define the loop (i.e. ForEach File
Enumerator)? I have used this functionality numerous times and have
never had an issue with it stopping execution when it has looped
through all the files. I'd have been interested to see your original
package to enumerate through the files .. from the sounds of things
you are picking up spreadsheets conforming to different templates and
running them through different dataflows. How were you identifying
the format of the xls? Did you consider having seperate loops for each
file type? This would allow them to load in parallel and also might
avoid the issues you were experiencing as there should never be any
confusion as to which xls connection to use (it's a bit of a stab-in-
the-dark, but I'm guessing that is what was causing your security
issue).

WRT the VS solution - personally I would definitely recommend keeping
the VB and SSIS together. This allows for easy versioning and source
control across the entire solution, and packages it up all nicely if
you ever need to hand it on to another developer/support team/etc.

Good Luck!
J
AddThis Social Bookmark Button