1

I'm new to using SQL Server, and I have been using it at my university by connecting to the university's network. I want to be able to use SQL Server locally and have installed it on my computer.

When I am faced with the "Connect to Server" box I'm not sure what to do. I'm not sure what I should have as my server name etc. I think I have two instances installed on my computer already but I just don't know how to connect.

Even if it requires starting from scratch, creating a new instance, whatever, I would really appreciate it if someone could guide me through the steps so that I can get practising on SQL Server. I've spent hours trying to sort this out and I'm just not sure what to do. Thanks :)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Edwards
  • 105
  • 2
  • 7

3 Answers3

1

You need to go to Start > All Programs > Microsoft SQL Server xxx > Configuration Tools > SQL Server xxxx Configuration Manager (replace xxxx with your SQL Server version number).

You should see a screen something like this:

enter image description here

Look for the SQL Server services - I have two on my machine here.

The name in the brackets after the SQL Server tells you the instance name:

  • if it's MSSQLSERVER (like my second line there) - it's the default, unnamed instance - you connect to it using ., (local), or machine-name as your server / instance name

  • if it's something else, that is your instance name - you connect to it using .\instance-name, (local)\instance-name, or machine-name\instance-name as your server / instance name

So in my case, to connect to the first instance, I'd use

.\SQLEXPRESS  
(local)\SQLEXPRESS
MyPC\SQLEXPRESS

as server/instance name, while the second instance can be reached by using

.
(local)
MyPC

and that's all there really is to this!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Hi. I have an SQLEXPRESS instance as well as an MSSQLSERVER instance, however neither will start. The state for both displays as 'stopped' and I get the error "request failed or the service did not respond in a timely fashion". I have no idea how to fix this... – Edwards May 10 '15 at 11:41
  • @Edwards: check your Windows event log to see if there's any useful information about why those services don't start. Otherwise uninstall & reinstall – marc_s May 10 '15 at 12:01
  • I think the problem might be that I have downloaded the wrong version, the version that I downloaded was Microsoft SQL Server 2012 Express Management Studio 64-bit (English). Which download would you suggest, Microsoft SQL Server 2012 Express with Tools 64-bit (English) perhaps? There are so many different ones to choose from... – Edwards May 10 '15 at 13:02
  • @Edwards: yes - the Express with Tools would be fine. The Management Studio of course is **only** the management GUI - not the SQL Server engine. – marc_s May 10 '15 at 13:42
0

It depends on if you installed a named instance or not. If you haven't . or your machine name will work. If you have setup a named instance, .\<instance_name> should work.

In your comment you said the instance name is SQLEXPRESS, so .\SQLEXPRESS should work for you.

Andy
  • 8,432
  • 6
  • 38
  • 76
  • Thanks for your response. I noticed that my instance named SQLEXPRESS is currently in the 'stopped' state. When I try to start it tells me that the "request failed or the service did not respond in a timely fashion". Any idea how to sort this out? – Edwards May 10 '15 at 00:49
  • @Edwards go to your Admin Tools, Services control panel to see if its actually running or not. If its not then start it. If it is, you'll need to launch SSMS as an administrator and then add your workstation logon to SQL server and grant yourself the sysadmin role. http://stackoverflow.com/questions/14814798/how-to-add-sysadmin-login-to-sql-server – Andy May 10 '15 at 00:57
  • When I try to start the instance by doing that it says the system cannot find the file specified? – Edwards May 10 '15 at 01:01
  • @Edwards did you reboot after you installed? try that. If you have your installation might be corrupt so I'd go to Programs and Features and try doing a repair. – Andy May 10 '15 at 01:03
  • Okay, I'll try rebooting, if this doesn't work what would you suggest I do? – Edwards May 10 '15 at 01:05
  • @Edwards Did you try doing the repair in Programs and Features? – Andy May 10 '15 at 15:02
0

If you have SQL Server set up to take requests over the network (even although it is only your own machine) you can use localhost, or the name of your machine. If not then you can use a dot .

If you have named the instance you'd use the format

.\name

or

localhost\name
Colin Mackay
  • 18,736
  • 7
  • 61
  • 88
  • Thanks for your response. I noticed that my instance named SQLEXPRESS is currently in the 'stopped' state. When I try to start it tells me that the "request failed or the service did not respond in a timely fashion". Any idea how to sort this out? – Edwards May 10 '15 at 00:37