record sequance of execution of sql scripts

  • Hi,

    we have "old" application that after SQL server instance installation runs 100+ sql scripts and create server triggers, several db(s), add objects to those db(s)

    Goal: Document name and sequence of execution of all the scripts.

    We can only use native SQL server tools and PowerShell.

    My first choice would be SQL Profiler.

    Problem

    1.SQL scripts might contain code for creation of more then 1 object so I can't compare script name to object created

    2.Not sure if any standard SQL profiler event can capture name of the SQL script executed .

    Thank you

    Alex

  • Scripts are loaded and executed by the application code, not by SQL Server. The only thing SQL Server sees is batches of statements being submitted.

    So no, there is no way to get the script name by using only SQL Server tools.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

Viewing 2 posts - 1 through 1 (of 1 total)

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