EXECUTE permission was denied for object ' sp_sdidebug ' (Database ' master ', owner ' dbo '). __ Database

Source: Internet
Author: User
Tags stack trace

When you are developing a Web site with VS2008, debugging your code (selecting a method attached to the process for debugging), you execute a SQL query times the following error: A server error in the "/VM" application. EXECUTE permission was denied for object ' sp_sdidebug ' (Database ' master ', owner ' dbo ').

Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

Exception Details: System.Data.SqlClient.SqlException: EXECUTE permission was denied for object ' sp_sdidebug ' (Database ' master ', owner ' dbo ').

Source Error:

Line 116:			dscommand.selectcommand.commandtext=sql;
Line 117:			Dscommand.selectcommand.commandtype=commandtype.text;
Row 118:			dsCommand.SelectCommand.Connection.Open ();
Row 119:			try
line:			{

source file:D:/work/vm/sqlserverdal/sqllink.cs Line:118

Stack trace:

[SqlException (0x80131904): Deny EXECUTE permission on object ' sp_sdidebug ' (Database ' master ', owner ' dbo '). ] System.Data.SqlClient.SqlConnection.OnError (SqlException exception, Boolean breakconnection) +1948826 System.Data.
   SqlClient.SqlInternalConnection.OnError (SqlException exception, Boolean breakconnection) +4844747
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning (Tdsparserstateobject stateobj) +194 System.Data.SqlClient.TdsParser.Run (Runbehavior runbehavior, SqlCommand Cmdhandler, SqlDataReader DataStream,
   Bulkcopysimpleresultset Bulkcopyhandler, Tdsparserstateobject stateobj) +2392 System.Data.SqlClient.SqlCommand.FinishExecuteReader (SqlDataReader ds, Runbehavior runbehavior, String resetoptionsstring) +204 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds (CommandBehavior cmdbehavior, Runbehavior Runbehavior, Boolean Returnstream, Boolean async) +954 System.Data.SqlClient.SqlCommand.RunExecuteReader ( CommandBehavior Cmdbehavior, Runbehavior runbehavior, Boolean returnstreAm, String method, dbasyncresult result) +162 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery (dbasyncresult result, String methodname, Boolean sendtopipe) +175 System.Data.SqlClient.SqlCommand.ExecuteNonQuery () +137 SYSTEM.D Ata. SqlClient.SqlConnection.IssueSQLDebug (UInt32 option, string machinename, UInt32 PID, UInt32 ID, string sdidllname, byte[ ] Data +561 System.Data.SqlClient.SqlConnection.CheckSQLDebug (sqldebugcontext SDC) +129 System.Data.SqlClient.SqlCo Nnection.
   Checksqldebugonconnect () +349 System.Data.SqlClient.SqlConnection.CompleteOpen () +4874985 System.Data.SqlClient.SqlConnection.Open () +185 Vm.SqlServerDAL.SqlLink.SelectSqlSet (String sql) in d:/work/vm/ sqlserverdal/sqllink.cs:118 Vm.SqlServerDAL.BaseEntity.clsCity.Load_HomeOftenCity () in d:/work/vm/sqlserverdal/ baseentity/clscity.cs:452 Vm.Vm.business.Hotel.HotelSearchGuoNei.bindChangQuCity () in d:/work/vm/web/business/ hotel/hotelsearchguonei.aspx.cs:39 Vm.Vm.business.Hotel.HotelSeArchguonei.page_load (Object sender, EventArgs e) in d:/work/vm/web/business/hotel/hotelsearchguonei.aspx.cs:30 System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr FP, object o, Object T, EventArgs e) +14 System.Web.Util.Call Ieventhandlerdelegateproxy.callback (Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad (EventArgs e) +99 Sy Stem. Web.UI.Control.LoadRecursive () +50 System.Web.UI.Page.ProcessRequestMain (Boolean includestagesbeforeasyncpoint,
 Boolean includestagesafterasyncpoint) +627

Version information: Microsoft. NET Framework Version: 2.0.50727.3053; asp.net version: 2.0.50727.3053

Baidu a bit, the solution is as follows:

The error of "Deny EXECUTE permissions on object ' sp_sdidebug ' (Database ' master ', owner ' dbo ') occurs when invoked in. Net."

This problem occurs when I start the project with the specified URL and then run the program after "Attach process". This problem is mainly caused by the debugging mechanism of the. net2005, when the program is started and the process is attached, he defaults to debugging SQL Server, which requires a patch to support it. So there is an error of "EXECUTE permission on object ' sp_sdidebug ' (Database ' master ', owner ' dbo ')." At this point we can handle the problem by changing its debug type and make debugging work.

In the Attach to Process dialog box, click the Select button after attaching to: To see that the default option is to "automatically determine the type of code to debug." When you are finished, select debug the following code and select only "managed". This will be done normally.

In addition, if the project is not able to start debugging, you can also specify in the project from a URL for debugging, after the start of the above method to attach the process to the debugger can also achieve the debugging of the project.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.