2

Is there any query to find all SQL services currently running on the server including SSRS, SSIS, SSAS?

Albert
  • 47
  • 1
  • 7

3 Answers3

2

The DBATools PowerShell module is very useful for such tasks.

You can use Get-DbaService function from DBATools to get list of SQL related services installed on one or more servers.

Get-DbaService -ComputerName YourServer

alroc
  • 1,694
  • 11
  • 20
Unkush
  • 314
  • 1
  • 8
1

If xp_cmdshell is enabled you could run this.

CREATE TABLE #WindowsSvc (results VARCHAR(MAX));
INSERT INTO #WindowsSvc
EXEC xp_cmdshell 'net start'
SELECT results FROM #WindowsSvc WHERE results LIKE '%SQL Server%'
nkdbajoe
  • 194
  • 2
  • 13
0

If you are OK to use xp_cmdshell you can call tasklist which shows running processes and their process_ids

exec xp_cmdshell "tasklist /FO TABLE"

Stephen Morris - Mo64
  • 4,656
  • 1
  • 10
  • 18