Determine whether a SQL Server exists ..
Posted by: Sahil Malik - blah.winsmarts.com,
on 17 Sep 2006 |
View original | Bookmarked: 0 time(s)
.. don't try connecting to it boy!!
"Does this SQL Server exist or not"? That is a good question.
I noticed this question come up in the ADO.NET public newsgroup recently. Most of the answers are "DUhh .. try connecting to it". Of course, That is the straightforward approach to this question is - lets try and connect to it, if it connects - it must exist eh?
I feel that approach is incorrect for two reasons:
a) Your SQL Server may not accept your credentials - or the pool may be full. And yet the SQL Server did exist, but didn't feel like talking with you.b) You will be stuck due to connection timeout issues. Thus creating an unresponsive application.
So you need to answer the real question - "Does this SQL Server...