Thursday, 2 September 2010

Testing database connectivity

Developer that I am, I've gone so far as to write throwaway console apps to test connectivity to a database server as a different user; hopefully I'll never have to do that again after learning about this really cool trick:

  • Create a new text file and change the extension to .udl
  • Double-click it
  • Select a provider, configure the options to connect and hit Test Connection (note the Use a specific user name and password option means SQL authentication; entering an AD account here will fail).
  • Start a console window as another user and execute the .udl file to connect as someone else using integrated security if necessary
  • Having ruled a security issue in or out, fix the problem!

UDL-database-connection 

A massive shout out to Todd Klindt for sharing this in one of his recent netcasts!!!

Ps. "OK" through to persist the connection details in the form of a connection string to your text file. Kinda helpful!

If you found this post helpful, please support my advertisers.

No comments:

Post a Comment

Spam comments will be deleted

Note: only a member of this blog may post a comment.