Solved

Is it possible to debug a Store Procedure on MSSMS after a unitTest that calls it  from VS ?

Posted on 2017-03-16
4
48 Views
Last Modified: 2017-03-20
Hello everyone,

I know how to debug a storeProc in MSSMS by launching the sp call from mssms with a breakpoint in it.
I know how to debug  in VS.....

but i dont know how to use both at the same time :
Is it possible to launch debug for a unittest  that call a SP and have MSSMS that  take over with the debug  and get back to VS  ?
If it's possible how can i do that ? i would appreciate a recipe or a link to it.

thank you in advance.

toshi
0
Comment
Question by:toshi_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 51

Expert Comment

by:Mark Wills
ID: 42054570
My short answer is "Not Easily". Too many limitations, so never really explored.

My long answer is (what I have always done) to edit the stored procedure to write a log. Then go through the log after the event.

My humble answer is... Not as far as I have ever needed to (use edit and write log). But, according to https://support.microsoft.com/en-au/help/316549/how-to-debug-stored-procedures-in-visual-studio-.net seems like you can. See Option 2.

But will hang around to see what other experts have to offer.
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 500 total points
ID: 42054581
Oh, and in VS2010 you used to connect to Server Explorer but in more recent, you now connect to SQL Server using Sql Server Object Explorer.

There is a good example here : https://www.codeproject.com/articles/1079275/debug-stored-procedures-in-visual-studio-and-ssms 

Seems like I need to brush up a bit more :) Still has a few limitations though...
0
 

Author Comment

by:toshi_
ID: 42056017
Thank you Mark !

toshi_
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 42056759
A pleasure, and thank you very much for your question :)

Cheers,
Mark Wills
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question