(1)
You need to verify (not just guess) that the SQL Server service is running. You can do this by going to Start > Control Panel > Administrative Tools > Services, and checking that the service SQL Server (SQLEXPRESS)
is running. If not, start it.
(2)
While you're in the services applet, also make sure that the service SQL Browser
is started. If not, start it.
(3)
You need to make sure that SQL Server is allowed to use TCP/IP or named pipes. You can turn these on by opening the SQL Server Configuration Manager (found under Start > Programs > Microsoft SQL Server 2005 > Configuration Tools), and make sure that TCP/IP and Named Pipes are enabled. Here my instance name is different but you can see that both of these protocols are disabled (you'll want to check under Protocols for SQLEXPRESS
):
(You'll need to restart the SQL Server service if you change these settings.)
(4)
While it is no longer used in current versions of SQL Server, you'll also want to check the Surface Area Configuration tool. This is also found under Start > Programs > Microsoft SQL Server 2005 > Configuration Tools. Click on "Surface Area Configuration for Services and Connections", then highlight SQLEXPRESS
(again my local instance name is SQL2005
but pretend it's the same as yours), and under Database Engine > Remote Connections, enable "Local and remote connections" for the option "Using both TCP/IP and named pipes." In the screen shot below I only have TCP/IP enabled. If you change these settings, hit Apply, and again you'll need to restart SQL Server for the changes to take effect.
(This won't help your current problem but you may need to enable this if you want to connect to SQL Server from other machines, and it may also help future readers who are trying to connect to SQL Server 2005 remotely.)
(5)
It may also help to shut off Windows Firewall temporarily, in case you are blocking yourself somehow. (Control Panel > Windows Firewall)
(6)
Review SQL Server's error log. You can get to this file at a path something like:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\
(I don't have an Express instance handy so the path might be slightly different on your machine.)
Now, in that folder there will be a file called ERRORLOG
... this is the most recent log file that was generated the last time SQL Server started. You can right-click this file and choose Open With... select notepad. You should see some lines like this:
2012-05... Authentication mode is MIXED.
...
2012-05...
Server name is 'something\SQLEXPRESS'. This is an informational
message only. No user action is required.
...
2012-05... Server
local connection provider is ready to accept connection on [
\.\pipe\SQLLocal\SQLEXPRESS ].
2012-05... Server local
connection provider is ready to accept connection on [
\.\pipe\MSSQL$SQLEXPRESS\sql\query ].
2012-05... Server is
listening on [ ::1 49164].
2012-05... Server is listening
on [ 127.0.0.1 49164].
...
2012-05... SQL Server is now
ready for client connections. This is an informational message; no
user action is required.
Please tell us which of these lines you don't see, and what the second line says where I wrote "something\SQLEXPRESS".