Package start and end times
I wanted to know if there is any system va开发者_Python百科riable which is can use to access package execution start and end times. My requirement is that i need to store this in 2 relevant fields in a table in the database.
Why don't you enable logging via the SSIS menu? You could configure SSIS to log events to a SQL Server.
That way, you will not only have the start and end time it will be much easier to locate any errors.
http://msdn.microsoft.com/en-us/library/ms139845.aspx
There's a variable system::Starttime and why don't you just use a getdate() function when you're saving to the DB
Use the SQL Server 2012 SSISDB execution or execution_component_phases tables
Starting with SQL 2012 you can grab this information directly from catalog.execution or catalog.execution_component_phases tables within the SSISDB database using the start_time and end_time columns. The package is identified by the package_name variable. Knowing this can really come in handy. (Kind of surprised nobody at all mentioned this since OP/June 2017).
https://learn.microsoft.com/en-us/sql/integration-services/system-views/catalog-execution-component-phases
Note:
This should save you the step of having to use a system variable, since the data is already in a table.
精彩评论