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
 SQL Server Administration (2000)
 SQL DBa

Author  Topic 

kristinaRR
Starting Member

5 Posts

Posted - 2007-10-15 : 05:48:18
Hi
i want to check if sql server 2000 is running(if not open sql server) and database is running every two minutes with a script.
thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-15 : 06:41:06
Try NET <service> which for Microsoft SQL Server is MSSQLSERVER.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

kristinaRR
Starting Member

5 Posts

Posted - 2007-10-15 : 07:26:18
hi maybe i should complete my request

EVery time my server-computer reboots I want to automaticlly check if a database in sql server si running. But not with services on COntrol Panel or SQl Agent but with a script which script will check if database is running every minute, this means that this script will check first if sql server is running(if not open sql server) and then a database.
thanks again
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-15 : 08:31:41
We have a script which issues a NET START every minute.

If the service is running it does nothing, of course. However, about once a year when something terrible happens it just restarts SQL Server Service.

(Actually, its a bit more smart thatn that. It does NOT restart the service if a specific filename exists; this allows us to create that filename (you could use Notepad, we have an ShortCut on the DeskTop) so that we can prevent the service restarting when we definitely want it stopped - e.g. maintenance.)

Kristen
Go to Top of Page
   

- Advertisement -