A: 

Check your SQL server configuration, make sure the TCP connections are enabled. You can also check that the SQL Browser service is started. Make sure you do not have a firewall that gets on the way. Make sure the SQL Server service is also started.

Locksfree
+1  A: 

This instance of SQL Server is running on the same PC you're connecting from? That's the implication of 'local'.

Possibilities :

1) Try (local) instead of local for the server name

2) Try 'MSSQLSERVER' as the name

3) Check the SQL Server Configuration Manager shows the same configuration options you're attempting to connect with, eg the same instance name, Named Pipes enabled, services running ok, etc.

EDIT :

Ok, what are you using to connect with? SQL Server Management Studio Express? Are you sure you installed an instance? The lack of SQLExpress in the services list would seem to indicate otherwise.

CodeByMoonlight
Thanks! Tried (local) and MSSQLSERVER but did not work for me. Everything is enabled in Configuration except VIA.
azamsharp
I selected the default instance when installing SQL SERVER 2005. I am using SQL SERVER Management Studio to connect (not the express version).
azamsharp
Is this definitely a local instance? Have you checked the Windows Firewall or whatever other firewall you have?
CodeByMoonlight
Thanks! i got it working I install SQL SERVER 2005 EXpress and then typed "." as the server name and it worked! Thanks for your help!
azamsharp
A: 

Did you install SQL Server on the default instance, or have you used named instances? If you've used named instances then the server will be server\instancename. If you don't know, then have a look in the Services administrative tool; you'll be able to determine the instance name, if any, from there).

You could also try connecting with the server name as a single period (i.e. simply ".") [caveat... I've not got access to SQL Server at the moment, but I think I've used this before now].

Chris J
+1  A: 

When you connect to a SQL Server you specify the name in the form {computername}\{instancename}. The {instancename} is the name of the SQL instance which was chosen during the SQL Server installation. For {computername} you can substitute the special names . or local when connecting to the localhost machine. If the SQL Server was installed as the Default instance then the instance name part must be omitted, so the connection Server name becomes just the computer name.

SQL Server Express installs by default an instance named SQLEXPRESS. The corresponding NT service name is MSSQL$SQLEXPRESS. The Server name in the connection dialog is .\SQLEXPRESS, local\SQLEXPRESS, localhost\SQLEXPRESS or {computername}\SQLEXPRESS (they're all the same).

If the SQL Server was installed as the Default instance name then the corresponding NT service name is MSSQLSERVER. The Server name in the connection dialog is ., local, localhost or {computername} (they're all the same).

If the SQL Server was installed as a named instance then the corresponding NT service name is MSSQL${INSTANCENAME}. The Server name in the connection dialog is .\{INSTANCENAME}, local\{INSTANCENAME}, localhost\{INSTANCENAME} or {computername}\{INSTANCENAME} (they're all the same).

When connecting from a remote computer to a SQL Server instance the SQL has to be configured to allow remote connection How to configure SQL Server 2005 to allow remote connections.

Remus Rusanu