TSQL Query to find the user the SQL services run as
Occasionally I need to look up what user the SQL Server services are running as, and when this happens, you can either run a quick query, or wade through the dialog boxes for the SQL Server services top see what user they are running as. I prefer the query, however this only runs on SQL Server 2008R2 SP1 or newer. Lets hope you are not running on a version older than that in todays world. If you need help upgrading contact us.
Here is the query that I use to look up the name each SQL Service is running as:
SELECT servicename, startup_type_desc, status_desc, service_account
FROM sys.dm_server_services
And here are some sample results:
A quick and easy way to look up what user the SQL Server services are running as.
More from Stedman Solutions:
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!
I can’t believe how handy this query is. Since I created the blog post, I have used this so many times to quickly look up who the SQL Server services are running as. This snippet of TSQL has saved me some much time lately.
-Steve Stedman.