Is there a system stored procedure to show the SQL Server Startup Service
Account id?
Thanks
Alex
No. You can read it from the registry though using
xp_instance_regread. If you run profiler while checking the
value in Enterprise Manager, you can see what is used to
view the account in EM - it's along the lines of:
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
-Sue
On Tue, 3 May 2005 04:44:04 -0700, "Alex Au" <Alex
Au@.discussions.microsoft.com> wrote:
>Is there a system stored procedure to show the SQL Server Startup Service
>Account id?
>Thanks
>Alex
|||Thank you very much. I did venture into the registry but did not know the
xp_regread stored procedure to read registry from within SQL Server.
I am developing a sp to kill all active users apart from the processes run
by Service account, hence the question.
Thanks again
"Sue Hoegemeier" wrote:
> No. You can read it from the registry though using
> xp_instance_regread. If you run profiler while checking the
> value in Enterprise Manager, you can see what is used to
> view the account in EM - it's along the lines of:
> 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
> -Sue
> On Tue, 3 May 2005 04:44:04 -0700, "Alex Au" <Alex
> Au@.discussions.microsoft.com> wrote:
>
>
|||you might also like to try this...
if object_id('tempdb..#Results')is not null drop table #Results
create table #Results(value nvarchar(4000))
insert into #Results(value)
exec xp_cmdshell 'wmic service get name,startname'
select
*
from
#Results
where
value like 'MSSQLSERVER %'
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server
"Alex Au" wrote:
> Is there a system stored procedure to show the SQL Server Startup Service
> Account id?
> Thanks
> Alex
No comments:
Post a Comment