Тёмный

Debug Stored Procedures in Visual Studio 

Data Vids (Data Vids)
Подписаться 3,3 тыс.
Просмотров 28 тыс.
50% 1

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.

Наука

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@DataVids
@DataVids 2 года назад
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)
@tem_vremenem_v_kanade
@tem_vremenem_v_kanade 19 дней назад
By far best vid on the subject. Thank you!
@biblefirst5691
@biblefirst5691 2 года назад
I want to be able to put a breakpoint on all my stored procedures and run code and just see which one gets hit. Is that possible ?
@DataVids
@DataVids 2 года назад
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)
@WoodworkingChimp
@WoodworkingChimp 2 года назад
Can this process be used to debug a trigger on INSERT, UPDATE or DELETE?
@DataVids
@DataVids 2 года назад
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.
@itsoverat6000
@itsoverat6000 Год назад
Thanks so much! I learned a lot watching this.
@tusharkuware
@tusharkuware 2 года назад
I found this video very useful for myself
@beingSenpai
@beingSenpai Год назад
can anyone help me when i hover i wont see any values and when i try to see through quick watch it shows error
@DataVids
@DataVids Год назад
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.
@yonatandaniyel5640
@yonatandaniyel5640 2 года назад
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!
@DataVids
@DataVids 2 года назад
What a pain!
@keithrobertson7579
@keithrobertson7579 2 года назад
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!
@keithrobertson7579
@keithrobertson7579 2 года назад
17.2 just released. Should be fixed now.
@gilisaac1260
@gilisaac1260 Год назад
Muito Obrigado amigo, você é um amigo!
@DataVids
@DataVids Год назад
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!
@gilisaac1260
@gilisaac1260 Год назад
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 🙏
@Norman_Fleming
@Norman_Fleming 2 года назад
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.
@DataVids
@DataVids 2 года назад
You're welcome! For me I just have both 2019 and 2022 installed on the same workstation.
@bolittos
@bolittos 10 месяцев назад
I want do it with my remote server no local server
@dunawayguitars7494
@dunawayguitars7494 2 года назад
Still not working in 2022
@lozn00
@lozn00 Год назад
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
@masqueradeee
@masqueradeee Год назад
Helpful 👍
@DataVids
@DataVids Год назад
Glad it helped!
@chrise202
@chrise202 2 года назад
Deleting VS 2022. Piece of buggy shit. Stick to 2019 until microsoft gets better at software.
Далее
75 How to debug stored procedure in sql server
14:41
Просмотров 17 тыс.
Million jamoasi - Amerikaga sayohat
12:37
Просмотров 350 тыс.
If Your Tech Job is Comfortable, You're in Danger
20:57
Debugging sql server stored procedures
15:11
Просмотров 241 тыс.
Move appSettings.json values to User Secrets
19:03
Просмотров 2,4 тыс.
Indexes in sql server   Part 35
11:13
Просмотров 839 тыс.
Последний настоящий Sony Ericsson
0:57
Секретные процессоры!
0:27
Просмотров 620 тыс.