In SQL Server 2008 R2 error occurred while start debugging, Error HRESULT E_FAIL has been returned from a call to a COM component. (mscorlib)

Haider Ali Wajihi picture Haider Ali Wajihi · Mar 25, 2013 · Viewed 19k times · Source

I am working on SQL Server 2008 R2 Express, when I am using SQL Server debugging feature from client pc, this error occurs:

The EXECUTE permission was denied on the object 'sp_enable_sql_debug', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)

My user name is 'HALI' and permission is assigned to me is 'public' and 'db_Owner',

now after this error I have assigned all permissions available. And all server roles.

Now at this time I got new error message,

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

Now what the solution would be for this error.

Answer

Anup Shah picture Anup Shah · Oct 26, 2013

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 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 the 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