Microsoft SQL Server, Error : 2

  • While connecting to SQL Server 2005, I am getting the following error.

    "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (Provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)"

    I restarted the Server and then tried to connect to SQL Server, it is allowing me to connect. Whenever the problem comes, I am restarting the server. But I want the actual solution for this problem.

    Can anybody help me out in solving this issue.

  • are you connecting to the local server or remote server?

    connecting using windows login/sqlserver login?

  • Yes, I am connecting to a local server.

    Using SQL Server Authentication.

  • Check if all the Services are running in sql server configuration manager

    check the protocols if they are enabled.

    You sometimes get the same error, when you have entered a wrong userid/pwd.

  • hi,

    im getting the same error but im using windows authentication - any suggestions? Thanks :o)

  • no worries, managed to solve it myself. basically i made sure all services were running as previously posted, and then, funnily enough, running SQL Server Management Studio as administrator did the trick!

    Thanks anyways :o)

  • Administrator shouldn't matter, it's the accounts that are set up in SQL Server. Likely the local administrator's group is set up as a login in SQL.

  • are you sure you have use the correct username and choose the right instance?

    the instance should be like this : server name/instance

    your username should be like this if you use windows au :server name /username

  • @ sundaram

    Choose the mixed mode of authentication

    Windows and the sql server

    Regards

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Please note: 2 year old thread.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • How was this error solved?

    Im having the same problem! plz help

  • are you sure you have use the correct username and choose the right instance?

    the instance should be like this : server name/instance

    your username should be like this if you use windows au :server name /username

    I solved the problem in this way ,you can have a try,make sure you have input the right ones:-)

  • hi

    Im not sure what 'instance' means. :unsure:

    Please correct what i have done wrong.

    Assuming the ff.

    name of my computer = HOMELAPTOP

    Username= ASHH

    Server type: Database Engine

    Server Name: HOMELAPTOP/SQLEXPRESS

    Authentication: windows authentication

    Username: HOMELAPTOP\ASHH

    Password: "left blank"

  • you can check your instance name by looking at the services maybe SQL service

  • It should be back slash: SQL Server Name\instance

    To find instance name:

    Click on Start> Programs > MS SQL ..2008 > Configuration Tools > SQL Server C.. Manager > SQL Services and the instance is SQL Server (MSSQLSERVER) so if you didnt make any changes during the instalation MS names it MSSQLSERVER.

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic. Login to reply