October 24, 2005 at 10:17 am
I'm trying to extract the Account that is being used for the SQL Server Agent....Is this information stored in a system table somewhere? Or is this something I have to go to the OS to find?
October 24, 2005 at 10:40 am
Found it:
sp_get_sqlagent_properties
Returns startup_account field in output. Apparently this stored procedure has to his the registry to find this info.
October 24, 2005 at 10:49 am
From EM, click on Management and right click SQL Server Agent. Select Properties - you can view and modify the info here.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
October 24, 2005 at 10:59 am
Thanks for the reply, but I'm trying to extract it using some type of SELECT statement.
October 25, 2005 at 11:39 am
Heres a the extracted code that you requested:
declare @startup_account nvarchar(100)
execute master.dbo.xp_regread N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Services\SQLServerAgent',
N'ObjectName',
@startup_account output,
N'no_output'
select @startup_account
This was taken from the SP that Buck mentioned earlier in the post. This works for a 'default' instance only. I'll leave it up to you to dig out the extra 3-4 lines of of code to make it work for either a 'default' or a 'named' instance !
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply