Debug by stepping through stored procedures in visual studio. Learn how to change values at runtime and create update scripts based on your changes, set breakpoints, watch values, and get the results you need.
Great comment from Malcolm on Facebook: Normal VS debugging leaves an open active transaction as it processes the code. So never use in production, as you risk locking other queries. Also, the small print on VS Community Edition means it can be used for production work, only Training, Learning and not for profit organisations (with limitations)
I guess it depends on how you are calling the stored procedure. In this example (this video) I set a breakpoint on calling the SP and inside the SP but i'm doing it from a SQL file. According to Microsoft its not possible to jump from application debugging to SQL debugging -> but, I would be curious if folks out there have found a way, and if so then are they using EF or not. Per microsoft "Note that with application debugging we cannot step into a database object from application code. We must explicitly set breakpoints in those stored procedures or UDFs where we want the debugger to stop." docs.microsoft.com/en-us/aspnet/web-forms/overview/data-access/advanced-data-access-scenarios/debugging-stored-procedures-cs (under debugging concepts)
Yes it can. You need to create a stored procedure to do the insert/update/delete, then step into it the same way as in this video. If you use F11 (step into), when you get to the insert statement inside of the stored procedure, it will jump to the trigger.
It sounds like the variable is out of scope. You might need the breakpoint at another point, or it could be you are in a multithreaded application and are looking at a variable that is populated on another thread. We might need more information to assist with this.
As of 3/23/2022 the bug is not fixed!! Damn it, I am so angry at microsoft! THey refused SP debugging in SSMS and now VS 2022 doesnt have proper SP debugging either!
4/20/2022 and still not fixed! Grrr. I'm totally with you. But after some searching I have the solution. It is fixed in current 17.2 previews. If VS Installer is not running, close it. Open VS 2022. Tools > Options > Product Updates > Change update settings. It will open VS Installer (though it looks a little different from what runs standalone, weird). Change update settings; set Update channel to Preview. Install the latest VS 17.2 Preview, wait an hour, and reboot. VS will be clearly marked as Preview, and in it, sproc debugging works!
Wonderful words, and based on google translate I believe you must be from portugul? Glad to have you here on my channel and please come again! have a great day friend!
Hahahaha, I'm from Brazil! Portuguese from Portugal is our mother language, it's the reason from lots of words seems like the Portuguese from Portugal. And again, thanks 🙏
Thank you for this video. There was a time several years ago where you could step from debugging VB code into the stored procedure and hit the breakpoints in there. Seem to remember you had to hit the SP once before you could set the breakpoint in it. Anyway, seems like they have been taking things away to bring it back later. 'Hot reload', lol you mean debug and continue. Anyway, thank you again for this video. Another reason NOT to go to VS2022.
Why isn't there a tool for foolproof repair that cannot remotely debug stored procedures, and a tool for foolproof repair that cannot be used in the Microsoft Store? AI learning? It's a bit ironic that as Microsoft officials, we should provide such tools. As users, it's difficult for us to solve some headache problems. We're not designers