sql-serversql-server-2008r2-express

Cannot connect to SQL Server 2008 R2 with Management studio


Today I get this strange exception:

Error HRESULT E_FAIL has been returned from a call to a COM component. (mscorlib)

I cannot connect to my database! Tool started under admin rights.

enter image description here

enter image description here

Services:

enter image description here


Solution

  • I am not sure if disabling firewall is enough. if the user has sysadmin permissions and still getting this error means client is not able to connect to server in debugging mode. check this TCP and UDP ports are correctly open.

    SQL remote debugging configuration

    EDIT:1

    I am sure you must have also googled a lot and tried to find out about the error messages. What I have found so far is the Error in the OP you mentioned is misleading and from that error, we cannot tell what exactly is wrong or what to look next. But as you replied in the comments, after making changes to enable Remote Debugger; the mentioned error is more clear and I feel that proper permission is still an issue. Plenty of other suggestion you also might have tried so far, but if you haven’t done this, let's try one more time:

    In one of the comments, I mentioned you to try login using the windows user.

    Now Keep the settings you already did for TCP ports, Firewall Exception etc… explained in the above link. you have windows 2012 server where you installed DB server. and windows 8 Prof where you have DB client and you connecting through SSMS. Now I believe both machines are in the same domain. Let’s say domain XYZ. You must have windows login on the server, let’s say it is “XYZ\HALI” using which you can login to the Windows Server. log in and make sure that login also exists in SQL SERVER with sysadmin permission. Because client machine is also in same domain make sure you have logged in into the client machine using same user “XYZ\HALI”. Now start SSMS and choose windows authentication instead of SQL SERVER authentication. Try to start Debugging T-SQL code now.

    if client and server machines are not in same domain then we have to register server name on client machine as Linked Server, impersonate the login/user as local and then try the debugging.

    Edit:2

    Login to SSMS using Windows Authentication