Monday, May 4, 2009

Debug SQL Server stored procedures in Visual Studio

We have a beautiful feature in Visual studio, where we can debug the stored procedures.
Follow steps below to debug SPROCS.

  1. Go to Server Explorer (Visual Studio -- View menu -- Server Explorer),
  2. Right click on Data Connections -- select Add Connection,
  3. Here type sql server name and select authentication type(windows or sqlserver), and then type your database. Click ok. Now you are connected to sql server.
  4. Select a SPROC and Right click on stored procedure -- select Step Into Stored Procedure.
  5. Give the default values to debug. Now it starts Debugging.
That's it!!! How simple it is...
Let me know your feedback on it,

2 comments:

  1. I followed all the above step I successfully added the Database.I can see all the Proc but when I am trying to step into store procedure...
    after clicking on it is not opening the SP.
    it showing Canceled by user message in the Output window.

    ReplyDelete
  2. I have also tried the same and getting the same error. Can you please help?

    ReplyDelete