Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 In SQL can you check for Running/ActiveServices

Author  Topic 

BobFord
Starting Member

2 Posts

Posted - 2004-11-07 : 21:04:21
I can currently obtain a list of Windows Service applications that are running on the current SQLServer computer by using the following:

CREATE TABLE #tmpServicesList (ServiceName VARCHAR(255))
INSERT INTO #tmpServicesList
EXEC master.dbo.xp_cmdshell 'Net Start'
if exists(select ServiceName from #tmpServicesList where ServiceName like '%Task Scheduler%')
begin
print 'Task Scheduler is running'
end else
begin
print 'Task Scheduler is not running'
end
select * from #tmpServicesList

drop table #tmpServicesList

However, I would like to be able to list the Services that are running on another computer in the same Domain that does not have SQLServer installed. The SQL will in a stored procedure that is called from time to time.

Any suggestions/examples would be appreciated...


Cheers

Bob

Kristen
Test

22859 Posts

Posted - 2004-11-08 : 02:08:45
There may be better ideas, but I think I would run a BATCH file on the other computer that does the NET START thingie, and outputs the results to a file - into a shared folder; schedule that (windows scheduler), and pull that results file into SQL

Kristen
Go to Top of Page
   

- Advertisement -