THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Linchi Shea

Checking out SQL Server via empirical data points

Picked a Wrong Name, But Connected to the Right Instance

I was doing some tests with a named SQL2000 instance called NYSQL\SQL2000. After I had run the tests for three hours, I came to realize, much to my dismay, that the server name used in all the connection strings in the tests was NYSQL instead of the intended NYSQL\SQL2000. I went, "Damn! I just wasted three hours!"

But then after some digging, I found that all connections in my tests were in fact made to the NYSQL\SQL2000 instance--the right instance, even though the server name was only NYSQL--a wrong name--in all the connection strings. To confirm that, I opened up Query Analyzer, and connected to NYSQL. I then executed SELECT @@SERVERNAME, and there, 'NYSQL\SQL2000' was returned.

Whew! I was lucky. But what happened to allow NYSQL to masquerade as NYSQL\SQL2000? Before you even go there, let me rule out the obvious--it had nothing to do with the client configuration. There was no alias on the client machine.

This is not a tricky question, and many of you may have already run into it. Nevertheless, it's interesting, and at the very first sight, non-intuitive. So it's a good exercise to be left for the reader who hasn't had the experience.

 

Published Saturday, July 14, 2007 11:41 PM by Linchi Shea

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Chuck said:

You used The Force?

July 17, 2007 2:22 PM
 

Linchi Shea said:

Tried to guide the electrons to the right instance with no luck. But no, not a SQL Jedi Master yet.

July 17, 2007 3:48 PM

Leave a Comment

(required) 
(required) 
Submit

About Linchi Shea

Checking out SQL Server via empirical data points

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement