SQL Server Programming Part 10 - Table Valued Functions

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии •

  • @BijouBakson
    @BijouBakson 3 года назад +3

    I'm watching this 7 years later and I must say this is gold stuff.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 года назад +1

      It's amazing that people still find them useful after so long! Thanks for watching!

  • @hombreazu1
    @hombreazu1 9 лет назад +12

    Your videos are far and above anything else available on the subject. Thank you for all your work.

  • @rajkumarrajan8059
    @rajkumarrajan8059 Год назад +1

    simply AMAZING!! you are AWESOME in explaining concepts

    • @WiseOwlTutorials
      @WiseOwlTutorials  Год назад

      Thanks so much! Happy to hear you're enjoying the videos, thanks for watching!

  • @rajendrampremnath
    @rajendrampremnath 10 лет назад +1

    Many thanks for all 12 parts. I am a starter. These videos explained very well. Thanks again!

  • @Mrleothelion86
    @Mrleothelion86 9 лет назад +2

    Thanks for these videos, really clear and succinct explanations. I really appreciate them!!!

  • @Kubapl418
    @Kubapl418 Год назад +1

    Great video, super useful even 10 years later.
    Is it possible to pass another table (or an array) as an argument? For example, I have a string of values separated by a comma and I would like to perform a clause where particular record contains a value equal to one in my string

    • @WiseOwlTutorials
      @WiseOwlTutorials  Год назад

      Hi! Yes, you can pass tables to parameters providing you use a user-defined table type as described here learn.microsoft.com/en-us/sql/relational-databases/tables/use-table-valued-parameters-database-engine?view=sql-server-ver16
      You probably don't need to do that to get the results you need though - you can use the string_split function to split a string into a table. So, for example, you could create a stored procedure like this:
      create proc usp_FilmsInString
      @MyString nvarchar(255)
      as
      select
      f.*
      from
      dbo.Film as f
      where
      f.Title in (
      select value
      from string_split(@MyString, ',')
      )
      and then call the procedure, passing your comma-separated string into it like this:
      exec usp_FilmsInString
      @MyString = 'die hard,lethal weapon,twilight'
      Here's the documentation for the function learn.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql?view=sql-server-ver16
      I hope it helps!

  • @frenkyb123
    @frenkyb123 9 лет назад

    Very good explanation, thanks a lot.

  • @TheQciap
    @TheQciap 10 лет назад

    Hi Andrew, great stuff ineed but I have qq:
    In a 4:42 you select bunch of text and then with one click you move it to the right to have nice structure of the code.
    Who do you do that?
    ;)

  • @oot007
    @oot007 7 лет назад

    best sql server videos by far and in clear english. well done. any plans for SSAS videos?

  • @TILARFHT
    @TILARFHT 7 лет назад +1

    YOU ARE AWESOME!

  • @patrickwheeler7107
    @patrickwheeler7107 6 лет назад

    Great video thanks!

  • @krismaly
    @krismaly 11 лет назад

    Very good explanation of ITVF and MSTVF.
    I think prefixing some characters before function name could identify ITVF and MSTVF may be good practice, since both are stored in the same location. What do you think?
    Thanks a lot

  • @zydra_ow
    @zydra_ow 2 года назад +1

    Awsome overview, even 9 years later. But couldn't you've just used union in the last example?
    select
    directorName, directorDOB, 'director'
    from
    tblDirector
    union
    select
    actorName, actorDOB, 'actor'
    from
    tblActor
    Thanks for the video

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 года назад +1

      You certainly could! As with many things in SQL there's often a variety of ways of achieving the same results!

  • @maulesi62-pro46
    @maulesi62-pro46 2 года назад +1

    Nice!!

  • @ipsitapani8641
    @ipsitapani8641 11 лет назад

    well explained sir but how to call function from store procedure.?

  • @bouggyhobbes9542
    @bouggyhobbes9542 6 лет назад

    You are very awesome

  • @Sgoose105
    @Sgoose105 Год назад

    why return suffices? shouldn't it be return @t

  • @simonlester4316
    @simonlester4316 Год назад

    Does oracle has an equivalent of sqlserver TVF ..??

    • @WiseOwlTutorials
      @WiseOwlTutorials  Год назад +1

      Hi Simon! A quick Google tells me yes, it does!

    • @simonlester4316
      @simonlester4316 Год назад

      @@WiseOwlTutorials thanks, just wondering if you have covered oracle in your series...

    • @WiseOwlTutorials
      @WiseOwlTutorials  Год назад

      @@simonlester4316 Hi Simon! Sorry, no, we don't have any PL/SQL videos.

  • @DanielBin100
    @DanielBin100 6 лет назад

    when I execute the function, it says that 'FilmName etc could not be bound'. Anyone knows why?

    • @TheDonMostro
      @TheDonMostro 5 лет назад

      Go to edit , intellisense, and refresh local cache

  • @BrankoDimitrijevic021
    @BrankoDimitrijevic021 10 лет назад

    `WHERE YEAR(field) = some_year` is not very good for performance, unless you actually have a computed index on `YEAR(field)`. Instead, it is better to have: `WHERE field >= start_of_year AND field < start_of_next_year`.
    Nice video, regardless.

  • @jeetsakharkar243
    @jeetsakharkar243 2 года назад

    How to calculate networking days in sql?
    Networking days = Saturday, sunday and all government holiday

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 года назад

      Hi! This link has lots of good suggestions stackoverflow.com/questions/252519/count-work-days-between-two-dates
      I hope it helps!

  • @RavikantRai21490
    @RavikantRai21490 9 лет назад

    So this is basically working like a stored procedure with a UNION inside of it.

    • @RavikantRai21490
      @RavikantRai21490 8 лет назад

      Yes. I meant in this video. Thank you for these videos. They're by far the best I've seen on the subject.