SQL Server Programming Part 3 - Variables

  Рет қаралды 172,342

WiseOwlTutorials

WiseOwlTutorials

Күн бұрын

Пікірлер: 98
@shuvbhowmickbestin
@shuvbhowmickbestin 8 ай бұрын
These lectures have the quality of a paid Udemy course, thanks to you sir for keeping it free on KZbin. You gained one more sub today.
@WiseOwlTutorials
@WiseOwlTutorials 8 ай бұрын
You're very welcome! Thank you for the comment and for watching!
@ddstutorials6048
@ddstutorials6048 7 жыл бұрын
Within five minutes of this video and one sentence of your description sir, you have gained a fan and sub for life. Thank you for taking the time to explain this material in an understandable way.
@Rational108
@Rational108 5 жыл бұрын
This is exactly what I was looking for from many days..I wish, I would've come here earlier.. but I am sure it will take me beyond from here..love from India 🇮🇳🇮🇳
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
But at least you found us eventually! Happy to hear that you're finding the videos useful, thank you for watching!
@blameonme1
@blameonme1 10 жыл бұрын
You are just too outstanding a teacher...thanks for the upload....learned and still learning alot from ur tutorials
@jaquesaulait7679
@jaquesaulait7679 7 жыл бұрын
How refreshing - an excellent presentation! Clear enunciation, good explanations at a good pace, and a clear screen; not too much going on, objectives clear and attained. Nice one, Wowl..!
@nikhilmunj108
@nikhilmunj108 7 жыл бұрын
Your way of making understand things is just awesome.You make it feel like cakewalk!!!!
@mmgebken
@mmgebken 10 жыл бұрын
Most excellent, I can understand his accent.
@patrickwheeler7107
@patrickwheeler7107 7 жыл бұрын
Thanks for sharing. We are moving to SSRS 2016 from BO and the wheels are turning in regards to reports with parameters. In the past I have mainly used Views to encompass complex code, but for reporting these are going to work out just fine! Thanks a bunch!
@navyahs4924
@navyahs4924 3 жыл бұрын
Very useful session. Each sentence is informative. Thank you for the neat and organized content and delivery.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
You're very welcome Navya, I'm happy to hear that you found it useful, thank you for watching!
@alanazana6744
@alanazana6744 9 жыл бұрын
Thanks for putting this tutorial on youtube. Its very helpful and exactly what I need.
@jasonmalan4679
@jasonmalan4679 3 жыл бұрын
You are a blessing, Thank you very much for your excellent and well thought out videos.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Thank you so much for the kind words and support Jason!
@clintoncalhoun9838
@clintoncalhoun9838 5 жыл бұрын
i've learned more from you than any tutorial in such quick time
@shanehawkins4158
@shanehawkins4158 7 жыл бұрын
I was struggling with this on my course and this explained it so much better , thanks
@fadwa2413
@fadwa2413 2 жыл бұрын
Thank You Andrew!! thanks for the upload....learned and still learning a lot from your tutorials
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Thanks Fadwa!
@arghyanandy6469
@arghyanandy6469 5 жыл бұрын
Your videos are so helpful. Thank you for sharing your knowledge with us.
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
You're very welcome! Thanks for taking the time to leave a comment and for watching!
@kylebecker5083
@kylebecker5083 4 жыл бұрын
This is a great explanation of variables. Thanks
@WiseOwlTutorials
@WiseOwlTutorials 4 жыл бұрын
You're welcome, Kyle! Thank you for the comment and for watching!
@duythanhao9808
@duythanhao9808 Жыл бұрын
you are outstanding teacher
@WiseOwlTutorials
@WiseOwlTutorials Жыл бұрын
Thanks so much!
@ItsWithinYou
@ItsWithinYou 2 жыл бұрын
Awesome! Thank YOU for sharing!
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
And thank you for watching!
@1976JT
@1976JT 5 жыл бұрын
THANKS! i am into this at this very moment in my school.
@channelnaresh9374
@channelnaresh9374 Жыл бұрын
Thanks for teaching it is very useful
@WiseOwlTutorials
@WiseOwlTutorials Жыл бұрын
You're very welcome, thanks for watching!
@donjr3270
@donjr3270 3 жыл бұрын
Thank you sir for this tutorial.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
You're welcome Don, thanks for watching!
@lewiscifer999
@lewiscifer999 11 жыл бұрын
Great thanks! Nothing specific, I just needed a general overview of what they do, how they work etc. I've heard that it can come up in Data Analyst interview questions and I'd like to have as many areas covered as possible!
@RandomAlexus
@RandomAlexus 9 жыл бұрын
Your channel is fantastic
@anditruman6979
@anditruman6979 10 жыл бұрын
Hi Andrew, thank you again for this series, too. I am a most avid student of yours. At about minute 15:55 the string is left with a comma and a blank at the end. I am kind of perfectionist and whenever I see s.th. that I would like to have different I try myself on it, which often times is difficult at first. So here I didn't like the comma and the blank left after the last name was added to @NameList. After struggling a little I found this solution and share it here (hoping that you do not mind): If (Right(@NameList,2)=', ') SELECT @NameList= Left(@NameList, LEN(@NameList)- 2) -- Check that there is no space left Print @NameList+'"' This doesn't belong yet into this lesson, I assume. But perhaps there is a solution that is integrated already into the original SELECT? Thank you, Andi
@deepskothi
@deepskothi 7 жыл бұрын
Thanks for the tutorials.. Course is well structured and helped me learn SQL server quicker (I come from Oracle scripting background). Couple of questions. (1) I do not see ';' being used as a statement terminator as used in Oracle/DB2 programming. With or without ; as the statement terminator program executes normally. What is the recommended best practice (2) At 16:55 if select is used instead of print, the actor list is outputted as a single line with each actor separated by a space. why is it select and print produce different form of output
@eshwarchow9
@eshwarchow9 12 жыл бұрын
thank you..Mr.Wise Owl.very useful video..
@guhansrinivasan7545
@guhansrinivasan7545 6 ай бұрын
Good explaination bro.
@WiseOwlTutorials
@WiseOwlTutorials 6 ай бұрын
Thanks!
@guhansrinivasan7545
@guhansrinivasan7545 6 ай бұрын
@@WiseOwlTutorials How long it takes to understand the flow of the advanced topics. Because I am a fresher and working as an intern.
@WiseOwlTutorials
@WiseOwlTutorials 6 ай бұрын
@@guhansrinivasan7545 There's no simple answer to that question! It depends on so many things. Just keep working at it, you'll get there!
@guhansrinivasan7545
@guhansrinivasan7545 6 ай бұрын
Thank you brother. I get your point but I feel like whether my approach is correct to do that in a secured way or not. A lot of questions go in my mind, that's why I asked your advice.
@JoeG2324
@JoeG2324 12 жыл бұрын
great job! keep the videos on sql coming.
@OM-mu1qt
@OM-mu1qt 3 жыл бұрын
Thank you soo much!
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
You're very welcome, thanks for watching!
@setudutta3905
@setudutta3905 5 жыл бұрын
Thank you very much
@marcin2x4
@marcin2x4 5 жыл бұрын
13:29 - If I remove TOP 1 instruction I get one row only. does lack of TOP instruction indicates to SQL Server to perform in on other record?
@kamran_desu
@kamran_desu 10 жыл бұрын
Just came across something that was puzzling me, but I just figured it out now, might be of use to others. Local variables are limited to the scope of the batch (GO) that they are declared in. Hence, if your variable is referenced outside the batch, you will get an error asking you to declare the variable. Was scratching my head for a while there.... XD
@GaryHutsonVBA
@GaryHutsonVBA 10 жыл бұрын
Cracking tutorial! Thanks Andrew! :)
@eshwarchow9
@eshwarchow9 12 жыл бұрын
more eegarly looking for ur videos ..
@julianstockli4634
@julianstockli4634 5 жыл бұрын
Is there a great difference between Oracle SQL and Microsoft SQL as far as the content of this videos is concerned?
@julianstockli4634
@julianstockli4634 5 жыл бұрын
I havent found any tutorials of similar quality using Oracle SQL, so I was wondering if it makes sense to just use yours to learn SQL even though I am going to use Oracle SQL afterwards?
@tamascsiszer7669
@tamascsiszer7669 7 жыл бұрын
Thank you. This is really good. :)
@lewiscifer999
@lewiscifer999 11 жыл бұрын
Thanks a million that's brilliant! That makes so much sense! So it eliminates the split screen that you'd get if you ran two separate queries! And as long as each query follows the required criteria could make the statement as complex as we need? E.g joins etc
@santhoshkunder6
@santhoshkunder6 8 жыл бұрын
Great Video!.What is the difference between variable and Parameter?
@AcquisitionCapitalist
@AcquisitionCapitalist 8 жыл бұрын
Really enjoying your videos thus far, Andrew. I'm following along and ran into a bit of confusion on the segment that runs from 11:45 to 14:15. I modified your code slightly, but it's not performing as expected. Instead of 'SELECT TOP 1', I tried "SELECT TOP 10', but the output only yields one result in the first results pane. I noticed that that result is the 10th result as ordered by ActorDOB (Paul Bettany instead of Simon Pegg), but I'm not understanding why it's limited to only that one. What am I missing? Thanks in advance for any wisdom you can impart. :)
@thiery572
@thiery572 5 жыл бұрын
Thanks.
@mihaelacostea5783
@mihaelacostea5783 6 жыл бұрын
so what's the meaning of the 'Film' as Type in the query? What is Film between brackets, why is it red, and what's Type?
@JoshuaDHarvey
@JoshuaDHarvey 5 жыл бұрын
On the last example where you declare the variable a concatenated string plus the result of the select query - does this work bc the query iterates the results from the query statement so it essentially does 5 passes in this particular query?
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
Hi Joshua, it's not an iterator, no, the query doesn't get executed once for each value (although you could use a cursor to do that if you really wanted to!). If you've upgraded to SQL Server 2017 there's a new function called STRING_AGG which provides an easier way to do this docs.microsoft.com/en-us/sql/t-sql/functions/string-agg-transact-sql?view=sql-server-2017 : DECLARE @NameList NVARCHAR(MAX) = '' SELECT @NameList = STRING_AGG(FirstName, ',') FROM Actor WHERE YEAR(DoB) = 1970 PRINT @NameList I hope that helps!
@chebiano
@chebiano 11 жыл бұрын
very useful video :) Thank You
@kontrabando
@kontrabando 10 жыл бұрын
Thanks!
@lewiscifer999
@lewiscifer999 11 жыл бұрын
Hi, Are there any vids on Unions?
@thiery572
@thiery572 5 жыл бұрын
When you said "r" it sounds funny, like "bwrr". 😊
@cprogramer123
@cprogramer123 11 жыл бұрын
Hello, thanks for the video, its very easy to follow, using this video i have created a procedure to which i pass a time stamp value, its gives me an error that i m trying to implicit convert varchar to date, can you help me out the right way to pass dates which are of the timestamp data type.
@niteshsingh4377
@niteshsingh4377 2 жыл бұрын
Can you tell me how have you changed the color for Varibles to green.
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Hi Nitesh! In the version of SQL Server Management Studio used in the video (the one which came packaged with SQL Server 2012), those were the default colours. If you want to replicate it: 1) Choose Tools | Options... 2) Choose Environment | Fonts and Colors 3) In the "Show settings for:" drop down list choose Text Editor 4) In the "Display items:" list choose Keyword 5) Set the "Item foreground:" property to the colour of your choice I hope it helps!
@derekjscott1
@derekjscott1 6 жыл бұрын
that was - amazing
@randlyce
@randlyce 2 жыл бұрын
how come when i used PG admin which runs postgre sql this does not work? is this one of those different flavour syntax?
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Basically, yes. This series of videos is specific to Microsoft SQL Server which uses Transact-SQL.
@mihaelacostea5783
@mihaelacostea5783 6 жыл бұрын
I have this error as a result: Çonversion failed when converting date and/or time from character string' --> can you please suggest a correction?
@eshwarchow9
@eshwarchow9 12 жыл бұрын
could u plz make a video on stored procedures with control flow statements, joins...after getting knowledge on joins i made one stored procedure with query containg 4 sql join statements,it doesn't work when i pass the parameters to stored procedure,but i got msg that stored procedure has created succesfully... is it possible to pass multiple values to stored procedure during execution by ussing in clause?
@adi_u
@adi_u 9 жыл бұрын
awesome!!!
@emirhancelebi8316
@emirhancelebi8316 6 жыл бұрын
You've already selected ActorDOB from TOP 1 row of ActorTable so why would you still need to specify WHERE clause ?
@dandaplays8808
@dandaplays8808 7 жыл бұрын
Hi, im not from uk, theres any option to buy your courses (e-learning courses) ??
@emilyf2641
@emilyf2641 8 жыл бұрын
Thanks for sharing. I am confused, what is a difference between parameters and variables in a stored procedure?
@emilyf2641
@emilyf2641 8 жыл бұрын
+WiseOwlTutorials Thank you again. your explanation was very helpful.
@powerbiguy326
@powerbiguy326 2 жыл бұрын
@@emilyf2641 what he told you ???, as in SSIS variables are dynamic with expression and parameters are static with global scope , but in ssms , it is bit confusing to get the difference between these 2 concepts
@rohansathasivam1266
@rohansathasivam1266 6 жыл бұрын
I love you!
@sminkan1
@sminkan1 11 жыл бұрын
thanks for the advice,i must know that beacuse i dont know what im typing when i follow examples from videos :) Beacuse im preparing for 70-461, all your videos are on SQL 2012 and can I use them to study for the exam?
@eshwarchow9
@eshwarchow9 12 жыл бұрын
let us example '@id' is a parameter in stored procedure which i have created succesfully...but i would like to get more than one id values during execution of stored procedure say exmple EXEC spfilmdata @id in (1,2,3)...here 1,2,3 ids how is it possible to pass multiple values through parameter to stored procedure..
@shahimkhlaifat
@shahimkhlaifat 9 жыл бұрын
dear im trying to build a table name through varubale but it is not working: could you help declare @name nvarchar(50); declare @text nvarchar(50); declare @date nvarchar(50); declare @ex nvarchar(50); set @text= 'shahim ' set @name=@text+@date set @date= 'rasha' set @ex= 'select * into' + QUOTENAME(@name)+ 'from Sample.dbo.Active;'; EXECUTE SP_EXECUTESQL @ex
@shahimkhlaifat
@shahimkhlaifat 9 жыл бұрын
***** thank you so much i have found this way and it is working fine, thank you again, really you are so helpful DECLARE @table_name varchar(max) SET @table_name= (SELECT 'TEST_' + DATENAME(YEAR,GETDATE()) + UPPER(DATENAME(MONTH,GETDATE())) ) --DROP THE TABLE IF IT ALREADY EXISTS IF EXISTS(SELECT name FROM sysobjects WHERE name =@table_name AND xtype = 'U') BEGIN EXEC('drop table ' + @table_name) END --CREATES TABLE FROM DYNAMIC VARIABLE AND INSERTS ROWS FROM ANOTHER TABLE EXEC('SELECT * INTO ' +@table_name+ ' FROM dbo.active')
@JoeG2324
@JoeG2324 12 жыл бұрын
can you do a video on dynamic sql?
@sminkan1
@sminkan1 11 жыл бұрын
WiseOwlTutorials, i just start to learn SQL ... and im very confused :) first in which of your tutorials i can find about var char,integer ... what they mean for what to use it etc etc.
@jayjayf9699
@jayjayf9699 6 жыл бұрын
Why did you use date time and not date?
@tulinkilic5233
@tulinkilic5233 8 жыл бұрын
Hi, First of all I would like to say thanx alot for this wonderful tutoring videos. I am having small problem. which I would like to apply what I learned from your videos. So, in this case I need some tables How can get the tabels. I got couple of your table what name is "movies and sheet6" from your other lesson. I got it from excell table. But I need to get other tables for sql tutoring videos. Such as tblDirector, tblActor etc... If you could help me I would be appreciated.
@tulinkilic5233
@tulinkilic5233 8 жыл бұрын
Hi, Thanks alot for your rapid answer. Although I have an other question. I have downloaded "Create Movies Database 2016" file there is no problem on that but ı could not find cast table in that DB what you use it at the end of "sql server programing part 6". Well I am so sory If I am being too much :( But I appreciated for all your help.
@tulinkilic5233
@tulinkilic5233 8 жыл бұрын
one more comment on that, the table names are different on that DB the one you are using on your tutorials as well as colum names :)
@tulinkilic5233
@tulinkilic5233 8 жыл бұрын
Hi, Its me again. I downloaded "pt7 Computed Columns" There are 2 folders start and end which one should ı open
@tulinkilic5233
@tulinkilic5233 8 жыл бұрын
PS: The ones I had dowload from sql server 2016 part 7 and part 8.
@krismaly
@krismaly 11 жыл бұрын
I liked @Namelist Thanks
@Radioactive-Cactus
@Radioactive-Cactus Жыл бұрын
Hi WiseOwl
@WiseOwlTutorials
@WiseOwlTutorials Жыл бұрын
Hi Dustin!
@hadireg
@hadireg 4 жыл бұрын
👍👍
@sauravchugh1501
@sauravchugh1501 3 жыл бұрын
your accent reminds me of hogwarts teachers, lol.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
😀 hopefully this lesson is more interesting than potions
@KitoKitko
@KitoKitko 2 жыл бұрын
Thanks!
SQL Server Programming Part 4 - Output Parameters & Return Values
12:16
WiseOwlTutorials
Рет қаралды 120 М.
SQL Server Programming Part 5 - IF Statements
13:17
WiseOwlTutorials
Рет қаралды 138 М.
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 97 МЛН
SQL Server Programming Part 6 - WHILE Loops
14:48
WiseOwlTutorials
Рет қаралды 133 М.
How to Use Variables in SQL Server - TSQL Examples
13:48
Sean MacKenzie Data Engineering
Рет қаралды 4,2 М.
SQL Server Programming Part 2 - Stored Procedure Parameters
20:48
WiseOwlTutorials
Рет қаралды 261 М.
SQL Tutorial - Working with Variables
10:19
BeardedDev
Рет қаралды 26 М.
SQL Server Programming Part 15 - DML Triggers
18:10
WiseOwlTutorials
Рет қаралды 83 М.
SQL Server Programming Part 12 - Cursors
27:19
WiseOwlTutorials
Рет қаралды 125 М.
SQL Server Programming Part 13 - Dynamic SQL
27:41
WiseOwlTutorials
Рет қаралды 100 М.
SQL Server Programming Part 14 - Transactions
23:08
WiseOwlTutorials
Рет қаралды 88 М.
Players push long pins through a cardboard box attempting to pop the balloon!
00:31