SQL: custom scalar functions

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

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

  • @Johanoeberg
    @Johanoeberg 13 лет назад

    Just got to give some feedback: Your screen casts are superb! Keep on rocking. Your approach is very easy to follow and straight forward. Thanks from Sweden!

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

    After looking at videos for 3 days straight I finally understand Scalar Functions, thank you sir your video made it much easier to understand.

  • @echalachew
    @echalachew 14 лет назад

    Hi Michael, thx for posting this...really helpful and easy to understand....plz keep on posting similar ones

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

    Thanks Mike. This was very helpful.

  • @cachwahed
    @cachwahed 13 лет назад

    The last cool trick you described is really helpful, but I guess that can decrease performance when you deal with huge table and little more complicated calculation, in such case I prefer Trigger (FOR INSERT/UPDATE) conjunction with UDF, than store calculated value in a field, so you don't need to calculate it for each query.

  • @michaelfudge
    @michaelfudge  12 лет назад

    @cachwahed very true. In large scale databases with more than a couple 100K rows I would not do this trick.

  • @cezudas
    @cezudas 12 лет назад

    thank you , Michael!!

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

    What error message are you getting?

  • @musicnevres
    @musicnevres 12 лет назад

    delimiter |
    create function if_report(@idname INT, @reportsto INT)
    returns bit as
    begin
    declate @result as bit
    if exists(select * from employees where employeeNumber = @id_name and reportsTo = @reports_to)
    set @result = 1
    else set @result = 0
    return @result
    end |
    what is wrong with this code..please answer