Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Job agent
Message
De
21/03/2014 12:41:33
 
 
À
21/03/2014 12:31:18
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2008 R2
Application:
Desktop
Divers
Thread ID:
01597051
Message ID:
01597063
Vues:
38
>>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 = ;
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform