I have run into a number of cases where I want to test a connection to a SQL (MSSQL) Server without having to resort to code. To do so is rather straight forward:
Create a new file, a simple txt file is fine, and rename the document to “TestDBConnection.udl” sans quotes and spaces.
Be sure to change its file extension to .udl as many windows systems will not show you the extension. If you are in Explorer in Windows 7 I can tell you the commands to get to the setting are Alt, T, O, CTRL + Tab. Here you can see the ‘Hide extensions for known file types’.
Open the file:
Under Connection, enter the SQL server hostname or IP
If testing a SQL alias:
Enter information to log on to the server”
*Choose Windows Authenticated security
Click the Refresh button.
If a successful connection was made, a list of databases will be accessible under section 3.
Otherwise, test as you would guess, it is fairly clear from here.