Script to Check SQL Server Connectivity

Written by VidhyaSagar. Posted in Scripts

Use this VB script to check SQL Server connectivity. You can add N number of SQL Server instances to verify its status.

Usage:

  • Download the sqlserverconnectivity.zip file and extract all the files to a folder
  • Make sure connectivity.vbs, serverlist.txt and model.xls files exists in the same folder
  • Open serverlist.txt file and add server name in each line.
  • Execute connectivity.vbs file, it will generate a new excel file with the status
  • In the excel created you can get the status in ServerStatus sheet and connectivity error details in Error sheet.

Success Report

server_connectivity_1

Failure Report

server_connectivity_2

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Tags: , ,

Trackback from your site.

Comments (1)

  • VidhyaSagar

    |

    There is one bug with the connectivity vb script. I have used SQL Native client provider 10 version in connection string, if you don’t have that provider then the script will loop infinetly in the first servername. This has been found by Suresh. I have now fixed the connection string by using SQL OLEDB provider and below is the connection string used in that vb script

    Conn.Open “Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=” & inlist(0) & “;”

    Thanks Suresh for pointing this out!!

    Reply

Leave a comment

*

Recent Comments

Amit Bhatt

|

Hi Deepak,

Thanks for such a nice article.

You missed one thing to add in code:
@article = ‘all’,

Hence the script will be like this:
EXEC sp_addsubscription
@publication = ‘mypublication’,
@article = ‘ALL’,
@subscriber = ‘Subscriberservername’,
@destination_db = ‘mydestinationdbname’,
@reserved=’Internal’

Error 18486 | Platformblog

|

[...] SQL-Articles » Troubleshooting Login failed Error 18456This is one of the infamous error message (and number) that most of the DBAs …. 18486. Login failed for user ‘%.*ls’ because the account is currently locked out. [...]

VidhyaSagar

|

Naveen,
I’ll check this out and get back to you.

balakiran

|

Thanks man, Very simple & easy to understand !!!!