Friday, July 13, 2007 1:44 PM
by
Joelp
SSIS Packages in C#
In a recent project, our team needed to run a nightly import service to insert a large dataset from an access .mdb file into a SQL Server database. The obvious solution was to use SQL Server Integration Services (SSIS) which I worried might turn out to be some trouble, but I was amazed to discover how simple it is to execute an SSIS Package that performs the import from within your code.
Jeff does a good job of explaining the basics here. I would only add that you must have SSIS installed on any machine you try to run this code on or you will encounter a very unhelpful error about "CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E}".
EDIT:
Another issue I encountered with executing SSIS packages from c# was in the connection permissions when trying to run the code on a different machine. I persistantly ran into "Login failed for user '[username]'." no matter the protection level, or imported configuration file. I finally worked around the issue by using windows auth on all sql connections.