SSIS object search using T-SQL

  • Comments posted to this topic are about the item SSIS object search using T-SQL

  • First off I just want to say that these queries were a great help. I'm not sure which version of SQL Server you are working with, but I am working in SQL Server 2008. I ran your queries as listed and found no data. It turns out in SQL Server 2008 the tables that you need to query are msdb.dbo.sysssispackages and msdb.dbo.sysssispackagefolders.

  • i take it this won't work if you have SSIS packages stored in the file system?

  • hmm maybe I should have done it that way.. all I did was write a little application that parsed the xml file, grabbed out all embedded sql statements and searched those...

    jp

  • Excellent article James. I also have to identify SSIS and SSRS code that might be affected by schema changes introduced by vendor updates to our core system. Your solution for SSIS packages in MSDB is more straightforward than mine. I might give it a whirl next time around.

    For SSRS I use a free utility called "Reporting Services Scripter" http://www.sqldbatips.com/showarticle.asp?ID=62

    For SSIS I use a script code task to dump the SSIS code out to XML files. Then I use a little freeware program called "Agent Ransack" to do text searches. http://www.mythicsoft.com/page.aspx?type=agentransack&page=home

    Here is the script task that uses the DTS object model to dump the xml:

    Public Sub Main()

    '

    ' Add your code here

    '

    Dim dtsapp As Application = New Application()

    Dim pInfos As PackageInfos = dtsapp.GetPackageInfos("\\Production Jobs", "server1", Nothing, Nothing)

    Dim pkg As Package

    Dim mFileOut As String

    For Each pInfo As PackageInfo In pInfos

    If pInfo.Flags = DTSPackageInfoFlags.Package Then

    pkg = dtsapp.LoadFromSqlServer("Production Jobs\" & pInfo.Name, "server1", Nothing, Nothing, Nothing)

    mFileOut = "J:\A2I SSIS and RDL Files\SSIS\" & pkg.Name & ".xml"

    dtsapp.SaveToXml(mFileOut, pkg, Nothing)

    End If

    Next

    pkg = Nothing

    Dts.TaskResult = Dts.Results.Success

    End Sub

  • lgoble (5/13/2010)


    First off I just want to say that these queries were a great help. I'm not sure which version of SQL Server you are working with, but I am working in SQL Server 2008. I ran your queries as listed and found no data. It turns out in SQL Server 2008 the tables that you need to query are msdb.dbo.sysssispackages and msdb.dbo.sysssispackagefolders.

    I should have been more clear that my code in the article that that the example was for SQL 2005. I assume that if you change the table names in the query for SQL 2008 that the search works in 2008?

  • alen teplitsky (5/13/2010)


    i take it this won't work if you have SSIS packages stored in the file system?

    This search is only for SSIS packages stored on the MSDB database.

  • alen teplitsky (5/13/2010)


    i take it this won't work if you have SSIS packages stored in the file system?

    Alen, if the dtsx files are stored in the file system, they are already in XML format and would be searchable as text.

  • JI should have been more clear that my code in the article that that the example was for SQL 2005. I assume that if you change the table names in the query for SQL 2008 that the search works in 2008?

    Yes, change the table names and they work great

  • Thanks for the article. Good stuff.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • James - Thank you. We're just looking at transitioning from SQL2000 DTS to 2005 SSIS and this helped me understand. Since you work a lot with SSIS can you tell me whether you have found how I might call a SSIS package to execute from VBA? Perhaps by executing a stored procedure from VBA where that stored proc executes the SSIS package?

    Thanks

  • Bill Boyer-284226 (5/13/2010)


    James - Thank you. We're just looking at transitioning from SQL2000 DTS to 2005 SSIS and this helped me understand. Since you work a lot with SSIS can you tell me whether you have found how I might call a SSIS package to execute from VBA? Perhaps by executing a stored procedure from VBA where that stored proc executes the SSIS package?

    Thanks

    Bill, if you are executing the VBA from the SQL Server then look into using DTSExec http://msdn.microsoft.com/en-us/library/ms162810.aspx. If it is from a remote machine, my approach would be to set up an unscheduled SQL Agent job to run the SSIS package. Then use sp_start_job to run the job. I think you will find that the SQL Agent and SSIS have been nicely integrated and it's easy to set up packages and run them in this fashion.

  • A number of our packages have XML that is encrypted. Is there a quick way to add decryption to these queries?

    I've been playing around a bit, but haven't found anything yet.

    Thanks!

  • Maria Vogel (6/10/2010)


    A number of our packages have XML that is encrypted. Is there a quick way to add decryption to these queries?

    I've been playing around a bit, but haven't found anything yet.

    Thanks!

    I would turn on SQL Profiler and trace the MSDB database when a encrypted package is opening to see how the SQL engine decrypts the SSIS package using a function or something else.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply