Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Job agent
Message
From
21/03/2014 12:41:33
 
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Environment versions
SQL Server:
SQL Server 2008 R2
Application:
Desktop
Miscellaneous
Thread ID:
01597051
Message ID:
01597063
Views:
37
>>Either really Kevin . Or whichever is easiest at the moment all the jobs are associated with sa
>
>OK, If you want to grab the service account associated with Agent, you can do this. There might be a better way, so I'll stand corrected if someone has something better.
>
>
>declare @ServiceAcctName varchar(100)
>set @ServiceAcctName = (select top 1 Service_Account FROM    sys.dm_server_services where servicename like '%Agent%')
>
>select @ServiceAcctName
>
>
>You might need to tweak the WHERE clause based on what the name of the Agent service happens to be.
>
>To get, inside a trigger, the name of the job that caused the trigger to fire....admittedly I'm not sure how to do that. I'd be curious myself to know, inside a trigger, how to "bubble up" to the job that caused the update, which in turn caused the trigger. And if you have multiple jobs running at once, if that's even 100% reliable.
>
>Maybe someone else has some ideas?

I was wondering about usinge something like EXECUTE AS LOGIN = ;
Previous
Reply
Map
View

Click here to load this message in the networking platform