How to find SSIS package that's calling / Executing a stored procedure?

Kumar Rnd 0 Reputation points
2024-02-05T21:57:23.22+00:00

May I know a SQL query OR some other way to know which SSIS package is calling / executing a stored procedure? Thanks, Kumar

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,895 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,467 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,206 Reputation points
    2024-02-05T22:06:34.6433333+00:00

    Hi @Kumar Rnd, SSIS packages are XML files with the .dtsx extension. So, you can use SQL Server's T-SQL and XQuery to query packages to answer any question.


  2. CosmogHong-MSFT 23,716 Reputation points Microsoft Vendor
    2024-02-06T01:52:47.7333333+00:00

    Hi @Kumar Rnd Here is a solution using PowerShell:

    function Get-StoredProcedure {
        [CmdletBinding()]
        [OutputType('System.Management.Automation.PSObject')]
        param(
            [Parameter(Position = 0, ValueFromPipeline)]
            [System.IO.FileInfo[]] $Path = (Get-ChildItem -Recurse -File)
        )
    
        process {
            foreach ($item in $Path) {
                [pscustomobject]@{
                    'Path'    = Split-Path -Parent -Path $item.FullName
                    'Name'    = $item.Name
                    'Command' = ($item | Select-String -Pattern 'exec(ute)?\s[^\s]+').Matches.Value
                }
            }
        }
    }
    

    Referring from this similar thread: Use Powershell to Find Stored Procedures in SSIS Packages.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments