From: Joachim Hofmann on
Hello,

I would like to get the name of the SQL Server Agent Account by a (SQL) - Query,
or, to ask otherwise, if a given login comes from the SQL Server Agent.

Thank You

Joachim
From: Uri Dimant on
DECLARE @serviceaccount varchar(100)

EXECUTE master.dbo.xp_instance_regread

N'HKEY_LOCAL_MACHINE',

N'SYSTEM\CurrentControlSet\Services\MSSQLSERVER',

N'ObjectName',

@ServiceAccount OUTPUT,

N'no_output'

SELECT @Serviceaccount





"Joachim Hofmann" <speicher(a)freenet.de> wrote in message
news:ejIRmM7BLHA.4308(a)TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I would like to get the name of the SQL Server Agent Account by a (SQL) -
> Query,
> or, to ask otherwise, if a given login comes from the SQL Server Agent.
>
> Thank You
>
> Joachim