Quickly Testing SQL Connectivity

TL;DR

Create an empty text file on your windows system and change its extension to ‘udl’ instead of ‘txt’. Open the file and a SQL connectivity windows opens for you to enter the details and test connection.

Background

Recently I got into a situation where an old app running perfectly for last few years suddenly stopped working complaining about connectivity to SQL Server. The logs generated by the app were not capturing details other than a ‘SQL Exception has occurred’.  There were no changes made to the app in some time so obviously the doubt was whether SQL server was fine or not.

Basic verification established that there was nothing wrong with SQL Server as well. Ping from the App Server to the machine hosting the SQL Server was working and port 1433  was also open which meant this was not a network problem but something deeper.

Next step in mind was to write a quick console app which tries to query sample data from this SQL Server, add extensive traces to captures details and give it a spin on the App Server.

While I was waiting for Visual Studio to open I tried to google if there’s another way to test SQL Connection and I stumble upon Test remote SQL connectivity EASILY!. Going through the link I recalled how easy it was to test a remote SQL connection and I had used it umpteen times while starting out as a developer.

Steps to test SQL Connection

1. Create a empty text file anywhere on your system
2. Open this ext file, go to the menu and select file=>save as
3. At the bottom of the dialog change the drop-down “Save as type” to all files and file name as test.udl

SaveAs-UDL
4. Press save and now you should see a new file with an icon diff from notepad associated with it.

UDL-Icon

5. Open the file and a SQL connectivity windows opens for you to enter the details and test connection.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s