Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When using SQL Server Management Studio for SQL Server 2008 R2 connecting to a local SQL Server 2008 R2 instance (version 10.50.2500), I know that if I am using the instance name (local)\sql2008 it will fail to attach the debugger to any queries I attempt to debug with the error message

Unable to start T-SQL Debugging. Could not connect to computer '(local)'. The requested name is valid, but no data of the requested type was found.

However, If I change that connection to src\sql2008 the debugger runs happily.

Are there any other differences in having your connection use the (local) alias other than the debugger issue I pointed out above?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

(local) will work with any programs that understand to change (local) or . or localhost into the machine's network location. I would imagine that is the issue with the debugger. But as long as the program you are using (i.e. SSMS) understands that translation, there is no behavior difference to worry about.

I would imagine for most production servers, most connections will not be happening from a local machine as you would have a separate database server for security, availability and performance. So for that reason, it may be better to refer to the server as you will from other machines, but most of the time when working locally I just connect to . or .\instanceName since I hate typing ;-)

share|improve this answer
    
Ok, I thought maybe if I was using (local) it would attempt to use something like shared memory for communication but changing it the name forced it to TCP/IP and that is the reason for the different debugger behavior. –  Scott Chamberlain Nov 26 '12 at 1:20
    
Ahh. Sorry I misunderstood the question you were asking, though. I actually don't believe it utilizes a different protocol but I'll check right now :) –  Mike Walsh Nov 26 '12 at 1:21
1  
Also the thought of attaching a debugger and stepping through a query (that would be taking locks on tables/rows as it executes queries that takes locks) on a production server makes me shudder, this is purely for a development environment. –  Scott Chamberlain Nov 26 '12 at 1:22
    
Yeah I should have given my standard disclaimer there that the debugger isn't for playing around but I guess I assumed you knew that if you knew enough to play with it :) –  Mike Walsh Nov 26 '12 at 1:23
1  
Localhost will actually work in any application. This is because there is an entry for localhost in the hosts file. . and (local) are actually being translated via the driver so they should work with anything that is using the actual Microsoft drivers. –  mrdenny Nov 26 '12 at 6:34
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.