Problem Statement
This might sound strange, but I am writing about a subject that has been around since 2005. However, since then, the objects within SSIS 2016 have changed and I recently had a customer request that prompted me to document my findings.
I needed to add and configure some features in an SSIS package and I had old .NET code that did the magic for me in 2007. I used the same code for my SQL 2016 SSIS package but it didn't work. WHAT?!?!
Solution
Some of the changes that were required included the following:
- OLE provider is now "Provider=SQLNCLI11.1"
- LogProvider object in SQL 2016 is no longer 2, it's 5: "DTS.LogProviderSQLServer.5"
- NOTE: As of when this blog post was written, this information could not be found on MSDN Online.
- And more...
Benefits of having objects in the package created programmatically
- The package framework allows for a standardized approach.
- Achieve more consistency in your SSIS packages created through package framework.
- Save time and be more accurate in designing the required changes.
- Understand the inner layer of SSIS package design.
Solution Breakdown
I am going to create or configure the below objects in a sample SSIS package
- Add a Connection Object
Dim conMgrDest As ConnectionManager = Pkg.Connections.Add("OLEDB") - Add Event Handlers
Pkg.EventHandlers.Add("OnError") - Set the SSIS Logging
Dim logProv As LogProvider = Pkg.LogProviders.Add("DTS.LogProviderSQLServer.5")
Pkg.LoggingMode
= DTSLoggingMode.Enabled
Pkg.LoggingOptions.EventFilter
= arrayEventFilter
Steps
- Download the Sample Solution
- I have created 4 empty SSIS packages that are in the "SampleEmptySSISPackages" folder, in the case of my customer I had 300 packages.
- Copy all packages into the "ToBeProcessed" folder.
- Open the solution, "DotNetCodeOnSSISPkgs.sln".
- Open "pkgFwDotNetCodeOnSSISPkgs.dtsx" and go to Parameters.
- Make sure that the "uPara_FolderPath" is pointing to the location of your "ToBeProcessed" folder.
- To create the Connection Manager, you will need to set the "SSISLogServer" and the "SSISLogDB".
- Run the SSIS package
Validating Results
To check the results, open the packages in the folder "ToBeProcessed" in Visual studio. You will see the changes mentioned below:
- New Connection Object "conn_OLEDB_SSISLoggingConnection" is added
- The Event Handlers: OnError, OnPostExecute and OnPreExecute events have been added at the package level.
- In the menu SSIS --> Logging, you will see the following items:
- Containers: Package is checked
- Providers and logs: new name has been added, "My SSIS Log Provider for SQL Server", and the same connection object has been used.
- Details: OnError, OnExecuteStatusChanged, OnPostExecute, OnPreExecute are all checked
NOTE: To do the test again, you must copy the sample files from the "SampleEmptySSISPackages" folder into the "ToBeProcessed" folder and rerun the "pkgFwDotNetCodeOnSSISPkgs.dtsx" package.
Hello! Do check the link for amazing offers, also thanks for sharing the amazing content.
ReplyDeleteBusiness Intelligence Consultant
Business Intelligence consulting Services
Thankyou for sharing Business Intelligence Service Providers India
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete