Тёмный

SQL Server Programming Part 6 - WHILE Loops 

WiseOwlTutorials
Подписаться 209 тыс.
Просмотров 133 тыс.
50% 1

If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos you can click this link www.wiseowl.co... to make a donation. Thanks for watching!
By Andrew Gould
www.wiseowl.co.uk - In SQL Server there is only one type of loop: a WHILE loop. This video teaches you how to use them, from the basic syntax of the WHILE statement, through how to use a SELECT statement within a loop. We'll also cover how to use the BREAK command to exit from a loop, what to do when you inevitably find yourself in an endless loop and, finally, a quick introduction to using loops with cursors.
You can download the script to create the Movies database used in this video at the following link:
www.wiseowl.co...
You can see the range of resources and courses we offer in SQL Server here:
www.wiseowl.co...
Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Microsoft Access, Microsoft PowerPoint, Microsoft Word, Microsoft Project, Microsoft Publisher, Microsoft Visio, SQL Server, Reporting Services, Analysis Services, Visual Studio, ASP.NET, VB.NET, C# and more!

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

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 41   
@juanisidrodiaz3093
@juanisidrodiaz3093 Год назад
More than 10 years and still a master of piece with a clear concept and explanation. Thanks a lot.
@WiseOwlTutorials
@WiseOwlTutorials Год назад
Thank you Juan!
@mistery4437
@mistery4437 8 лет назад
Your rhetoric is lucid, controlled, non-persuasive and engrossing. A Masterclass. Thanks, Again.
@marcjohnson6621
@marcjohnson6621 10 лет назад
One of the clearest explanations I've seen. Well done.
@koporcic
@koporcic 4 года назад
I needed to learn store procedures, then I was needing everything in this tutorial in this exact order... you deserve the subscribe!
@WiseOwlTutorials
@WiseOwlTutorials 4 года назад
Happy to hear that you found what you were looking for, Ivo!
@michaelo8622
@michaelo8622 9 лет назад
Great tutorial! You sound like a wise owl :) It's very pleasant to the ears.
@m.a.saberi7606
@m.a.saberi7606 6 лет назад
your teaching skill is perfect and your accent is very clear and cute.
@zerolosi
@zerolosi 2 года назад
Such an amazingly clear video
@WiseOwlTutorials
@WiseOwlTutorials 2 года назад
Thanks! Happy to hear you found it useful, thanks for watching!
@estuardojuchuna
@estuardojuchuna 8 лет назад
THANKS BRO .... saved me from a big problem!
@krismaly
@krismaly 11 лет назад
Good introduction of CURSORS. I enjoyed the video. Thanks
@RayanJawad110
@RayanJawad110 11 лет назад
Thanks - you're tutorials are awesome!
@elvinabdullayev2451
@elvinabdullayev2451 9 месяцев назад
Great, great, great!
@WiseOwlTutorials
@WiseOwlTutorials 9 месяцев назад
Thanks, thanks, thanks! 😀
@lagz89
@lagz89 4 года назад
Great teaching, thank you
@gildewinter4185
@gildewinter4185 7 лет назад
a very good video. clear explanations .rock on
@jefrinraj5482
@jefrinraj5482 10 дней назад
Hi, You've go a nice set of collective videos that are Quiet easy to understand !! Can I get the resources, like all of the database for my practice?
@shahimkhlaifat
@shahimkhlaifat 10 лет назад
Yours are very very helpful thank you, but you might ignore the 'print statement' and go for sql database and show the loop in manipulating the data instead. most of the people are not looking to print messages in sql.
@CNich90
@CNich90 8 месяцев назад
First things first, this is by far the best course on stored procedures I have come across. So thank you so much! I have a question in regards to the use of the global variables; what if multiple store procedures are running at the same time? Would they interfere with each other when referencing the global variables?
@WiseOwlTutorials
@WiseOwlTutorials 8 месяцев назад
Hi Christopher! You can't declare global variables in T-SQL (at least as far as I know). There are some system functions which begin with @@ (such as @@ROWCOUNT) which Microsoft used to refer to as global variables in earlier versions of SQL Server but they are functions rather than variables. I hope that helps!
@CNich90
@CNich90 8 месяцев назад
@@WiseOwlTutorials Global function makes way more sense. Thanks so much!
@WiseOwlTutorials
@WiseOwlTutorials 8 месяцев назад
@@CNich90 No problem!
@loam
@loam 5 лет назад
Good one.
@evancito2
@evancito2 9 лет назад
thanks man!
@mehmethuseyinozcan
@mehmethuseyinozcan 7 лет назад
Thanks you are the best .... Guys! other way for better solution for seeing 0 film 9 and 10 oscars line set @numberFilms = (select COUNT(*) from tblFilm f where f.FilmOscarWins = @count) if @numberFilms != 0 begin print cast(@numberFilms as varchar(3)) + ' Films have ' + Cast(@count as varchar(2)) + ' Oscars' end
@piyushsikka5663
@piyushsikka5663 4 года назад
Thank you ! you videos are very helpful ! could you please tell me how to go through all rows of one column and print them using loop
@lb33isu
@lb33isu 7 лет назад
Very good videos with clear didactic style. I am a highly experienced Oracle pl/sql programmer who wants to have the skill level to convert to a t-sql programmer since my current employability is bit limited. What experience to you have with Oracle developers becoming t-sql/SQL Server programmers in terms of required effort and success rate in finding SQL Server roles? Thx.
@adifrenkenberg
@adifrenkenberg 5 лет назад
why did you define the films oscar wins as 'MAX'? Wouldn't it work the same without it?
@BenChi87
@BenChi87 10 лет назад
Thank you for your very helpful walk-throughs! What software do you use to make your screen capture videos?
@BenChi87
@BenChi87 10 лет назад
What free tool would you recommend? I have tried Camtasia but it only has a free trial period. The issue that I then ran up against is that when I uploaded the video - and perhaps this is due to my inadequacy with RU-vid - it would change resolution during the video, downgrading to the point that it wasn't clear anymore. Whatever advice you could give would be wonderfully useful! Thanks!
@xwan2737
@xwan2737 10 лет назад
Really awl some, I just have a question about the "if ……break" clause, according to the result, the result set will be truncated if @NumFilms=0, but the result for the films that won 11 Oscars is truncated at the same time! We just want to delete the @NumFilms=0 result. How to solve it??
@jw11432
@jw11432 2 года назад
This is exactly what I noticed and was wondering about.
@jesusernestocasteloestrada6535
wich two films won 11 oscar?? :O
@hardbrocklife
@hardbrocklife 4 года назад
I thought I was going to have to learn Hindi to learn anything about sql lol. Jk...but still.
@Hjominbonrun
@Hjominbonrun 10 лет назад
This is a good video showing how it works, but you need to start the video stating clearly that a while loop,recursive CTE's and cursors must be done as last resort and only if you have convinced the DBA that there is absolutely no other way.
@jackroark6928
@jackroark6928 6 лет назад
nah, you don't need to scare newbies off yet at this point