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 |
|
zzaaqq1112003
Starting Member
4 Posts |
Posted - 2003-02-05 : 17:57:08
|
| Hi,What is the best way of checking that you can insert data to a database every x minutes, send an up/down notification to a remote agent.Thanks, |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-02-05 : 18:03:46
|
| Scheduled tasksDamian |
 |
|
|
zzaaqq1112003
Starting Member
4 Posts |
Posted - 2003-02-05 : 18:52:44
|
| Thanks.Would I be checking the availability at the instance level or database level ? I am thinking the db level makes more sense because each database in an instance can be taken offline/detached etc without effecting others.Has anyone got a tool for the availability checking or recommend some tools ?Thanks. |
 |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2003-02-05 : 18:53:13
|
| Ummm DMO maybe?Just a gues...Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
 |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2003-02-06 : 15:39:50
|
Here's an example using VBScript.Const cSQLServer = "(local)" 'supply your servernameConst SQLDMOSvc_Running = 1Const cDb = "pubs" 'supply your database name 'or you can loop through the 'Databases collectionDim oSQLDim MsgDim statusOn Error Resume NextSet oSQL = WScript.CreateObject("SQLDMO.SQLServer")oSQL.Name = cSQLServeroSQL.LoginSecure = TrueoSQL.LoginTimeout = 10If (oSQL.Status <> SQLDMOSvc_Running or Err.Number<>0) Then Msg = "SQL Service for Server " & cSQLServer & " is not running" 'Send an email or whatever Set oSQL = Nothing WScript.Quit(1)Else oSQL.Connect If Err.Number<>0 Then Msg = "Could not connect to Server " & cSQLServer 'Send an email or whatever Set oSQL = Nothing WScript.Quit(1) End IfEnd Ifstatus = oSQL.Databases(cDb).StatusIf (status<>0) or (Err.Number<>0) Then Msg = "Database " & cDb & " for Server " &_ cSQLServer & " has a non-normal status" 'Send an email or whatever oSQL.DisConnect Set oSQL = Nothing WScript.Quit(1)Else oSQL.DisConnect Set oSQL = Nothing WScript.Quit(0)End IfHTHJasper Smith |
 |
|
|
|
|
|