Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Tuesday, March 20, 2012

Current executing task

Hi everyone

I'm trying to write a monitoring application for SSIS packages deployed on my machine. I know I can look at running packages via the DtsRuntime.Application object's GetRunningPackages method. Does anyone know if there is any way one can view tasks in that package that are currently being executed?

Cheers

Sachin

Wow! Brilliant! I was hoping for at least one reply... I guess I have to question whether this is possible or not. :)|||

You can, but it comes down to implementing the IDTSEvents interface, and/or overriding the packageEvents class.

You will then override the the function's OnPreExecute/OnPostExecute in your execution + monitoring application.

This "get current running tasks" would be much eaiser if there were not in bug in Application.GetRunningPackages() in which in InstanceId (the unique job execution identifier) does not match the execution id in the logs. If it did, you could call get running Packages, and then use logging to determine what was running and be close to on the money.

To me, the bug is analogous to logging the SQL Server spid in SQL profiler, but having it never match "select spid from master..sysprocesses".

|||

sachin.rao wrote:

Wow! Brilliant! I was hoping for at least one reply... I guess I have to question whether this is possible or not. :)

You posted at 17:09 and then sent this reply at 09:20 on the next working day. GIve people a chance! Also, nobody is required to answer you know.

As jaegd said, you can derive this by looking at the OnPreExecute/OnPostExecute events.

-Jamie

|||

Ok. Thanks jaegd.

Jamie - I realize that nobody has to answer. No offense intended. It was just that 50-odd people had viewed the topic and there hadn't been a response, so I was just thinking out aloud. That's all.

Sunday, February 19, 2012

csvde from Execute Process Task not returning groupType

When I run csvde from within an SSIS package's Execute Process Task, it does not return the groupType attribute, but when I run it directly from a command prompt, it does return that attribute. The csvde swiches are set the same in both cases:

-t 3268 -u -f allGroups.csv -d "DC=corp,DC=microsoft,DC=com" -r "(objectClass=group)" -l "groupType,mail,member"

The header line in the output file produced by the package is:

DN,member,mail,member;range=0-1499

while the header line in the file produced when csvde is run directly is:

DN,member,groupType,mail,member;range=0-1499

Has anyone else encountered this behavior?

Thanks,

Ron Rice

How do you have the Execute Process task setup?

Also, you may want to specify a full path to the -f flag.|||

Phil,

Unfortunately, making the -f switch a full path did not change the results.

I also tried changing the order of the attributes in the -l switch to "mail,groupType,member". At first I thought this had worked, because it did return the groupType attribute, but then I noticed that the "mail" attribute was not returned after making this change!

So for whatever reason, when I execute csvde from a package, the first attribute in the -l switch is not returned.

Thanks,

Ron

|||

Drop the double quotes around the -l flag parameters.

-l mail,groupType,member

|||

Phil,

Removing the double quotes from around the -l switch list of attributes did fix the problem. Thanks!

I wonder why csvde would behave differently when run in an Execute Process task versus being run directly from a command prompt. Also, I tried running it using T-SQL and xp_cmdshell, and that had the same problem. And I seem to remember running into issues concerning double quotes when I ran the bcp command from an Execute Process task, as well.

Whatever the ultimate cause of the problem, now that I know the work-around I am a happy camper!

Ron

|||

Rice31416 wrote:

Whatever the ultimate cause of the problem, now that I know the work-around I am a happy camper!

Ron

It's not really a work around. According to the csvde page, double quotes are not required. (See the examples at the bottom.)

http://technet2.microsoft.com/WindowsServer/en/Library/1050686f-3464-41af-b7e4-016ab0c4db261033.mspx