0

I already have SQL server 2008 R2 on my system. I also installed SQL server 2012 express. Then, I uninstalled it and installed SQL server 2012 commercial edition. I cannot connect to my DB via management studio. These weird errors happen to me all the time - 2005, 2008, 2012. The numbers change. TCP/IP is enabled, service is enabled. I just want to be able to connect and put some test databases for learning.

Please help me to fix the error below -

Cannot connect to SuperPC\SQLEXPRESS.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
Steam
  • 9,368
  • 27
  • 83
  • 122
  • SuperPC\SQLEXPRESS suggests that your still trying to connect to the old express edition. What is the instance name of the new installation ? – Johnv2020 Sep 27 '13 at 20:47
  • @Johnv2020 - SQL2012 is the name of the latest installation. – Steam Sep 27 '13 at 20:48
  • if this is the case then connect to SuperPC\SQL2012 – Johnv2020 Sep 27 '13 at 20:50
  • @Johnv2020 - Okay, I did that. But, how do I make that express go away. It should not even be there in the first place. – Steam Sep 27 '13 at 20:51
  • if it has been cleanly uninstalled (check your running services for MS SQL (SQLEXPRESS) service - this shouldn't be there) then it has gone away, its just that sql management studio maintains a list of the instances you have previously connected to. – Johnv2020 Sep 27 '13 at 20:54

2 Answers2

2

Make sure that the SQL Server Service is running. Go to services from start menu, and see SQL Server, if it's not running just right click and select Start.

0

When you uninstalled SQL Express you removed the SuperPC\SQLEXPRESS instance of SQL from your system. You will need to use a different SQL instance name. You would have set this name in the 2012 commercial version installation.

If the SQL 2008 R2 instance is the default instance on your system then the commercial SQL 2012 instance would have been installed as a named instance and you'd need to connect to it using the instance name you indicated during installation. You would connect to it using SuperPC\[new instance name] where you replace [new instance name] with the name of the instance you set during installation.

If the SQL 2008 R2 instance is not the default instance, then the new SQL 2012 instance MAY have been installed as the default instance, in which case you just connect to it using SuperPC. It COULD still have been installed as a named instance in which case you would need to follow the directions in the above paragraph.

EDIT:
Based on your comment on your question, try connecting with SuperPC\Sql2012.

squillman
  • 13,363
  • 3
  • 41
  • 60
  • Its so weird. Why does it even try to connect to a DB that does not exist ? – Steam Sep 27 '13 at 20:50
  • I use the latest instance now and I can connect. But, how do I make that express go away. It should not even be there in the first place. – Steam Sep 27 '13 at 20:52
  • What do you mean by "that express"? Are you talking about something in Management Studio? – squillman Sep 27 '13 at 20:54
  • My bad. That option of connect to SQLEXPRESS should not be there in Management studio because I uninstalled it. That is what i meant be "express". – Steam Sep 27 '13 at 20:55
  • If you're talking about a registered connection, then that's expected behavior. You have to manually remove it. SSMS can have registered connections for SQL Instances that don't exist anymore. SQL Installation doesn't do anything with those. – squillman Sep 27 '13 at 20:56
  • How do I remove the dead registered connections ? – Steam Sep 27 '13 at 20:57
  • @blasto [you press Delete when they're highlighted](http://blogs.msdn.com/b/managingsql/archive/2011/07/13/deleting-old-server-names-from-quot-connect-to-server-quot-dialog-in-ssms.aspx). – Aaron Bertrand Sep 27 '13 at 20:58
  • Right-click on it and select Delete. – squillman Sep 27 '13 at 20:58
  • @AaronBertrand - I did that and the text got deleted. But, the names of the servers still appear in the drop down list. I understand that I could continue using sql 2012, but its good to know how to fix this thing. – Steam Sep 27 '13 at 21:02
  • @blasto you will have to press Delete once for each entry in the list. Sometimes the same server can appear multiple times if you used different authentication methods. – Aaron Bertrand Sep 27 '13 at 21:03
  • @blasto If you're talking about the drop-down in the Connect to Server window then have a look here: http://stackoverflow.com/questions/1059105/how-to-remove-server-name-items-from-history-of-sql-server-management-studio – squillman Sep 27 '13 at 21:05
  • @blasto see http://stackoverflow.com/questions/1059105/how-to-remove-server-name-items-from-history-of-sql-server-management-studio/10996072#10996072 and also make sure you right-click any no-longer-present servers in View > Registered Servers. – Aaron Bertrand Sep 27 '13 at 21:09
  • @AaronBertrand - Deleted non-existing servers as per your steps before anything else. The names in the connection box won't go. – Steam Sep 27 '13 at 21:29
  • @blasto are you sure you are using Management Studio 2012? – Aaron Bertrand Sep 27 '13 at 21:33