Reputation: 13
I am new to SSIS. My problem is , I have to do a databse query. Then, I have to do a web service call passing in the result that I got from the db query, to the web service . Either I can use sql task first for db query and web service task next for web service call. Another way is to do do entire thing in the c# code and put that in script task. I can use enterprise library for doing db query through the C# code and then call the web service. What is the better approach to do it ?Which one gives better performance?
Upvotes: 1
Views: 1657
Reputation: 7744
Both approaches can work. Both will likely result in approximately the same performance - usually the query execution on SQL Server is the slowest part, and it does not matter how you invoke it.
But if you do everything in C# code and put it in script task - what is the benefit of SSIS? You can as well do everything in C# and put it in standalone console app.
Usually one uses SSIS to avoid writing code, and use declarative program definition - which is more maintainable, easier for others to understand and support, etc. Someone who opens a package and sees SQL task and Web Service task will be able to understand and tweak what's going on without opening Script Task and examining the code. It also requires less developer expertise to maintain such package.
Script Task is then only used when something can't be done directly by existing SSIS task or transform. If I saw a package with all the code in a Script Task - I would ask why the person used SSIS at all? Doing it with standalone console app would be simpler, more reliable (than the same code inside Script Task), avoid unnecessary dependency, etc.
Short: if you DO use SSIS - avoid Script Task when possible.
Upvotes: 5