Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed VS2010 and it automatically installed SQL Server 2008 Express.

Now, the installed instance is called SQLEXPRESS, therefore to connect to it I have to use 'localhost\SQLEXPRESS' or '.\SQLEXPRESS' or something like that.

I want to rename the instance so I can connect using only my computer name or 'localhost'.

How do I do this?

Thanks

share|improve this question

3 Answers 3

up vote 8 down vote accepted

There is no way you can rename an instance of SQL Server. You can probably create a new instance with just the machine name so that it suits you requirements.

I'm not sure of the express version of SQL Server bundled with VS 2010, but with the Standalone SQL Express 2008 (or R2), running the setup again will let you create a new instance.

enter image description here

share|improve this answer
    
+1 You will need to re run the setup (this will create a new instance of SQL Server) and make sure that you select the Default Instance. This will allow you to connect without specifying any name or juts a '.' –  Ganesh R. Jun 30 '11 at 6:49
    
Thanks, I ended up uninstalling the previous version and installing it again. –  willvv Jul 1 '11 at 16:26

I was always under the very strong impression (I am only questioning it a little for the first time due to the conflicts in the link below) that you can only do that by reinstalling SQL (I have always had to create additional instances with an additional install anyway), and choosing a new instance name. I found the link below on a Microsoft SQL Server forum that has a very divided opinion. I side with the Microsoft MVP moderator, because I think that the attempted change only changes the server name though.

I would follow the advice of detaching the databases, reinstall SQL with the new instance name, and then reattach. That is guaranteed to work.

http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/9541a5b7-658d-42b1-85ee-110ba61aa28a/

share|improve this answer

I followed the procedure mentioned in http://sqldbpool.com/2008/09/03/how-to-change-sql-server-instance-name/like this

For default instance

sp_dropserver 'old_name'
go
sp_addserver 'new_name','local'
go

For named instance

sp_dropserver 'Server Name\old_Instance_name'
go
sp_addserver 'ServerName\New Instance Name','local'
go

and then restarted the SQL server.

Now I'm able to connect to both default instance and SQLExpress

share|improve this answer

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.