April 17, 2011 at 2:46 pm
Any t-sql which can tell me if a particular package is running or not? Under the folder "Running Packages" it really doesnt say if the package is running or not. Please help!!
April 18, 2011 at 9:13 am
Since you didn't specify a version, I'm going to reply based on SQL 2005. You best bet is tables in the MSDB database that are named dbo.sysdtsxxxx - these tables hold all the package execution details. Specifically, dbo.sysdtslog90 gives a good basic history of package execution.
SELECT [id],[event],[computer],[operator],[source],[sourceid],[executionid],[starttime],[endtime],[datacode],[databytes],[message] FROM [msdb].[dbo].[sysdtslog90]
And dbo.sysjobactivity should show any currently executing packages.
SELECT [session_id],[job_id],[run_requested_date],[run_requested_source],[queued_date],[start_execution_date],[last_executed_step_id],[last_executed_step_date],[stop_execution_date],[job_history_id],[next_scheduled_run_date] FROM [msdb].[dbo].[sysjobactivity]
Another useful table is dbo.sysdtspackages90, which will give a listing of all your stored packages. Note that there is also a table named dbo.sysdtspackages, which is used for compatibility with legacy DTS packages.
Joshua Perry
http://www.greenarrow.net
April 18, 2011 at 10:21 pm
Thanks. None of your queries gave me list of currently running packages (:. In the second query, you do not have any column referring to SSIS package? I do see some packages running under the "Running Packages" folder in SSIS. We are on sql 2005. Are you sure this query worked for you in finding currently executing packages?
April 19, 2011 at 2:21 am
sqldba_icon (4/18/2011)
Thanks. None of your queries gave me list of currently running packages (:. In the second query, you do not have any column referring to SSIS package? I do see some packages running under the "Running Packages" folder in SSIS. We are on sql 2005. Are you sure this query worked for you in finding currently executing packages?
Use a profiler trace to capture what is hitting your server and it will give you a hostname too. From there you can find out how these packages are being executed and from where.
April 19, 2011 at 8:28 am
chandan_jha18 (4/19/2011)
sqldba_icon (4/18/2011)
Thanks. None of your queries gave me list of currently running packages (:. In the second query, you do not have any column referring to SSIS package? I do see some packages running under the "Running Packages" folder in SSIS. We are on sql 2005. Are you sure this query worked for you in finding currently executing packages?Use a profiler trace to capture what is hitting your server and it will give you a hostname too. From there you can find out how these packages are being executed and from where.
Oh yeah for sure i could do that :). Just wanted to avoid using trace, i am so surprised there isnt a query to find running SSIS packages on a server?
April 19, 2011 at 10:19 am
I think I understand what you're asking for now. That's not exposed via TSQL, but you could use some .NET code and expose it through an assembly that can be called with TSQL.
Keep in mind that this has the same limitation of the Running Packages folder in SSMS - administrators will see all packages, and other users will only see packages they have started.
So, if you want to expose a list of all running packages to all users, you would need to create the assembly and execute the TSQL with a proxy. Or you could display the list of packges in an application using the collection object that is returned.
Joshua Perry
http://www.greenarrow.net
April 20, 2011 at 10:59 am
Joshua M Perry (4/19/2011)
I think I understand what you're asking for now. That's not exposed via TSQL, but you could use some .NET code and expose it through an assembly that can be called with TSQL.Keep in mind that this has the same limitation of the Running Packages folder in SSMS - administrators will see all packages, and other users will only see packages they have started.
So, if you want to expose a list of all running packages to all users, you would need to create the assembly and execute the TSQL with a proxy. Or you could display the list of packges in an application using the collection object that is returned.
Thanks yeah i knew that i could do this using .net code. What do u mean by "same limitation of the Running Packages folder in SSMS - administrators will see all packages". I am admin on the box as well as sql server. I still cannot see packages running under the RUnning Packages folder.
April 20, 2011 at 11:07 am
In addition to system level roles, the running packages folder uses the SSIS roles in the MSDB database. By default, logins with the db_dtsadmin or sysadmin role will see all packages, logins with the db_dtsoperator and db_dtsoperator roles will only see packages they started.
Joshua Perry
http://www.greenarrow.net
April 9, 2015 at 4:42 pm
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply