Question: How to Identify Process ID for SQL Server Services?
Answer: I was recently asked this question during the Comprehensive Database Performance Health Check. Let us see a quick script which returns the process id for SQL Server Services.
SELECT ServiceName, status_desc, process_id, last_startup_time, service_account FROM sys.dm_server_services
When you run above script you will get information like service status, process Id, last startup time and service account. Let us see the result of the query ran above.
Well, that’s it for today’s blog post. Here are few of the previous interview questions, please do not miss to read them.
- How to Check Status of Instant File Initialization? – Interview Question of the Week #184
- How Old Version of SQL Server Running on Server? – Interview Question of the Week #183
- How to Convert Hex Windows Error Codes to the Meaningful Error Message – 0x80040002 and 0x80040005 and others? – Interview Question of the Week #182
- How to Generate Random Password in SQL Server? – Interview Question of the Week #181
- How to Check Edition Specific Features Enabled In SQL Server? – Interview Question of the Week #180
- How to Find Service Account for SQL Server and SQL Server Agent? – Interview Question of the Week #179
- How Much Work Each Processor (CPU) is Doing in SQL Server? – Interview Question of the Week #178
- How to Find Cardinality or Uniqueness for any Column? – Interview Question of the Week #177
Reference:Â Pinal Dave (https://blog.SQLAuthority.com)