Change SQLEXPRESS instance name

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


Solution 1:

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

Solution 2:

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/