Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server stored procedure conversion to SSIS Package

Problem: currently we have numerous stored procedures (very long up to 10,000 lines) which were written by various developers for various requirements in last 10 years. It has become hard now to manage those complex/long stored procedures (with no proper documentation).

We plan to move those stored procedure into SSIS ETL package.

Has anybody done this is past? If yes, what approach should one take.

Appreciate if anybody could provide advise on approach to convert stored procedure into SSIS ETL Packages.

Thanks

like image 539
Lokesh Sharma Avatar asked May 28 '11 17:05

Lokesh Sharma


People also ask

Can I run SSIS package by using a stored procedure?

The stored procedure activity executes a stored procedure in the SSISDB database to run your SSIS package.

What are the advantages of using SSIS packages over stored procedures?

They are far easier to maintain, we don't need bids, don't need to create projects and import packages into bids, so far fewer steps to make simple stored proc changes.


1 Answers

I've done this before, and what worked well for my team was to refactor incrementally, starting with the original source, and then iterate the refactoring effort.

The first step was to attempt to modularize the stored procedure logic into Execute SQL tasks that we chained together. Each task was tested and approved, then we'd integrate and ensure that the new process matched the results of the legacy procedures.

After this point, we could divide the individual Execute SQL tasks across the team, and load-balance the analysis of whether we could further refactor the SQL within the Execute SQL tasks to native SSIS tasks.

Each refactoring was individually unit tested and then integration tested to ensure that the overall process output still behaved like the legacy procedures.

like image 189
arcain Avatar answered Sep 28 '22 07:09

arcain