user415042
user415042

Reputation: 1

Package start and end times

I wanted to know if there is any system variable 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.

Upvotes: 0

Views: 8327

Answers (3)

Sting
Sting

Reputation: 352

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.

Upvotes: 0

SPE109
SPE109

Reputation: 2951

There's a variable system::Starttime and why don't you just use a getdate() function when you're saving to the DB

Upvotes: 2

codingbadger
codingbadger

Reputation: 44042

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

Upvotes: 4

Related Questions