Follow sqlserver-dba.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

SQLServer-DBA.com Links

Dba_db2_button

dba-ninja.com

SQL Server DBA Jobs

sys.dm_server_services - How to check if SQL Server service is running or not?

25 September,2024 by Tom Collins

Question: Is there a way to check SQL Server services related details - such as process id , last start up time ?

Answer:  Use the sys.dm_server_services . According to the Microsoft dopcumentation   the prurpose of this DMV are :

"Returns information about the SQL Server, Full-Text, SQL Server Launchpad service (SQL Server 2017 (14.x) and later versions), and SQL Server Agent services in the current instance of SQL Server. Use this dynamic management view to report status information about these services."

 

SELECT  d_s_s.servicename,
        d_s_s.startup_type_desc,
        d_s_s.status_desc,
        d_s_s.last_startup_time,
        d_s_s.service_account,
        d_s_s.is_clustered,
        d_s_s.cluster_nodename,
        d_s_s.filename,
        d_s_s.startup_type,
        d_s_s.status,
        d_s_s.process_id
FROM    sys.dm_server_services AS d_s_s;




There are also some alternative methods for  reviewing the status of SQL Server services . If you  have enough privileges you could read How to check if SQL Server Agent is running using t-sql or if you're looking to use Powershell and need to check on SSAS - How to check SSAS service status with Powershell

 


Author: Tom Collins (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on sys.dm_server_services - How to check if SQL Server service is running or not?


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer