Database Connectivity Test with UDL File

Posted by Ben Griswold on Johnny Coder See other posts from Johnny Coder or by Ben Griswold
Published on Sat, 12 Jun 2010 20:54:52 +0000 Indexed on 2010/06/12 21:03 UTC
Read the original article Hit count: 473

I bounced around between projects a lot last week.  What each project had in common was the need to validate at least one SQL connection.  Whether you have SQL tools like SSMS installed or not, this is a very easy task if you are aware of the UDL (Universal Data Link) files. 

Create a new file and name it anything as long as it has the .udl extension. Open the file, choose a provider:

image

Click Next >> or navigate to the Connection Tab to provide connection information.  Once you provide server and login credentials, the database list will populate.  At this point, you know the connection is valid. but go ahead and click the Test Connection button anyway.

image

On the final tab, you can provide extra connection information like Application Name which can come in handy

image

The All tab is beneficial if you want to build a valid connection string to include in your own applications.  If you save the file and then open in Notepad, you’ll find that said connection string:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=(local);Application Name=TestApp

I hope this tip helps save you some time.  How do you test if you don’t have SSMS installed?

© Johnny Coder or respective owner

Related posts about deployment

Related posts about SQL Server