Microsoft SQL Server, Error : 2

  • sundaram82

    Mr or Mrs. 500

    Points: 534

    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.

  • dba_pkashyap

    Hall of Fame

    Points: 3226

    are you connecting to the local server or remote server?

    connecting using windows login/sqlserver login?

  • sundaram82

    Mr or Mrs. 500

    Points: 534

    Yes, I am connecting to a local server.

    Using SQL Server Authentication.

  • dba_pkashyap

    Hall of Fame

    Points: 3226

    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.

  • pollo1984

    SSC Veteran

    Points: 223

    hi,

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

  • pollo1984

    SSC Veteran

    Points: 223

    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)

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 715095

    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.

  • 281462596

    Old Hand

    Points: 309

    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

  • SkyBVI

    SSCoach

    Points: 15111

    @ sundaram

    Choose the mixed mode of authentication

    Windows and the sql server

    Regards

    Sushant

  • Gail Shaw

    SSC Guru

    Points: 1004424

    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
  • 14653966

    SSC Enthusiast

    Points: 158

    How was this error solved?

    Im having the same problem! plz help

  • 281462596

    Old Hand

    Points: 309

    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:-)

  • 14653966

    SSC Enthusiast

    Points: 158

    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"

  • 281462596

    Old Hand

    Points: 309

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

  • dkgcb

    SSC Enthusiast

    Points: 127

    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 20 total)

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