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.
Author |
Topic |
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2008-10-22 : 04:04:40
|
IS there any script to check whether Sql server is up or nt?Thanks |
|
Peace2007
Posting Yak Master
239 Posts |
Posted - 2008-10-22 : 04:07:12
|
when a sql server is not up you cannot run a script at all because you cannot connect to that! |
 |
|
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2008-10-22 : 04:09:26
|
There must be smeway to check whethere the service is running or not? |
 |
|
Peace2007
Posting Yak Master
239 Posts |
Posted - 2008-10-22 : 04:30:51
|
this link may help you:http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3937906&SiteID=17and this is to check if SQLAgent is running: declare @service nvarchar(100)select @service = case when charindex('\',@@servername)>0 then N'SQLAgent$'+@@servicename else N'SQLSERVERAGENT' endexec master..xp_servicecontrol N'QUERYSTATE', @service |
 |
|
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2008-10-22 : 04:40:41
|
Yes,i have the idea about Sql Server agent statuis.i was looking for something on sql server service status.suppose i have 100 servers and i need to chekc the status of the service of sql server?What do i do? |
 |
|
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2008-10-22 : 05:41:23
|
Here you goThanks to Kalman(SQL USA) for thisdeclare @CMDresult table ( Linetext varchar(255))insert @CMDresultexec xp_cmdshell 'sqlcmd /L'delete @CMDresult where Linetext is null or Linetext = ''select * from @CMDresultThanks |
 |
|
ghemant
Starting Member
22 Posts |
|
|
|
|