Friday, February 10, 2012

Check the sql server service account

Hello!

I would need to check the name of the sql server service account from inside TSQL.

I had one idea about reading from the sysprocesses system table,
but that only gives me information about the SQL Server Agent service account.

Are there other ways?

(It has to work for both SQL Server 2000 and SQL Server 2005.)

Best regards

Ola Hallengren

There is an undocmented approach using 'registry key reading' in SQL Server 2000 version:

xp_regread @.rootkey='HKEY_LOCAL_MACHINE',
@.key='SYSTEM\ControlSet001\Services\SQLServerAgent',
@.value_name='ObjectName'

I'm working onSQL 2005 and will post here once it is successful.

No comments:

Post a Comment