November 16, 2007 at 5:35 am
Hi Everybody,
i wanna chek the opposite server status whether it is running or shutdown.
this task i wanted to do thru DTS package(SQL 2000). for that i have choosen Activex scripting where i can place the VB script or Java Script to check the status of the server.
according to my requirement if server is running DTS shud send successful msg. If not DTS shud send shutdown msg. Based on this task only i can do further.
arj
November 16, 2007 at 6:51 am
I'd keep it simple... create a linked server to the "other" server. Then do a SELECT TOP 1 * FROM [linkedservername].Master.dbo.Sysobjects (or, in 2k5, I think it would be the sys.Objects view, not sure). If it doesn't error, the server is up and running 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2007 at 10:01 am
there's so many levels you can check, it depends on what you want to do.
For example:
--you can ping a server via a script to see if DNS works/server exists on the network.
--then you can check to see if the service for SQL server is running (and you might need to check for multiple instances, or for a specific instance.
--from there, like Jeff Model exampled, you might need to check if the SQL Server is allowing connectivity at all,
--from there, you might need to confirm that a specific database exists on the server (master.dbo.sysdatabases)
--after that, you might need to check if the SQL Server is allowing connectivity to that specific database
Lowell
November 16, 2007 at 8:32 pm
I wrote a DTS package like this a long time ago (back in 2001). Basically I used ADO to attempt to make a connection. I then checked the status of the connection. It only took about 10 lines of code. That's probably the easiest way to do it in an ActiveX Scripting task. This also precludes the requirement to have hard-coded linked server connections.
K. Brian Kelley
@kbriankelley
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply