Forum Replies Created

Viewing 15 posts - 4,096 through 4,110 (of 8,753 total)

  • RE: Why Scalar Functions Can Be Costly

    Alan.B (1/4/2016)


    I been banging my head trying to beat that mTVF for several months :hehe:

    Anything to ease the pain cause that got to hurt:-D

    😎

  • RE: Why Scalar Functions Can Be Costly

    Alan.B (1/4/2016)


    Eirikur Eiriksson (1/4/2016)


    Worse still are the multi-statement table-valued functions, in fact there is no excuse or justification for using those.

    I agree with this 99.9999% of the time but I...

  • RE: Today's Random Word!

    crookj (1/4/2016)


    TomThomson (1/4/2016)


    HappyGeek (1/4/2016)


    Ed Wagner (1/4/2016)


    DonlSimpson (1/4/2016)


    whereisSQL? (1/4/2016)


    Eirikur Eiriksson (1/4/2016)


    Ed Wagner (1/4/2016)


    Grumpy DBA (1/4/2016)


    Ed Wagner (12/31/2015)


    Luis Cazares (12/31/2015)


    Ed Wagner (12/31/2015)


    DonlSimpson (12/31/2015)


    Yoda

    Qui-Gon

    Obi-Wan

    Anakin

    Whiner

    Users

    Function

    Dysfunction

    Staind

    Paint

    Red

    Flag

    Banner

    Slogan

  • RE: Why Scalar Functions Can Be Costly

    bjh1977 (1/4/2016)


    Small correction required - UDFs came in as part of 2000 didn't they?

    That's correct.

    😎

  • RE: Why Scalar Functions Can Be Costly

    Phil Parkin (1/4/2016)


    TheSQLGuru (1/4/2016)


    lucien.jacquet (1/4/2016)


    My point is not to contradict your assertion that scalar functions "can be" expensive, but to suggest that your example is a worst-case scenario. Is it...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (1/4/2016)


    A bit late, but best wishes for everyone!

    BLTN:-D

    😎

  • RE: Today's Random Word!

    Ed Wagner (1/4/2016)


    Grumpy DBA (1/4/2016)


    Ed Wagner (12/31/2015)


    Luis Cazares (12/31/2015)


    Ed Wagner (12/31/2015)


    DonlSimpson (12/31/2015)


    Yoda

    Qui-Gon

    Obi-Wan

    Anakin

    Whiner

    Users

    Function

  • RE: Record count in results

    Another quick solution, similar to John's apart from this one is counting in both directions

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    /* SAMPLE DATA SET */

    ;WITH SAMPLE_DATA(RN,NAME) AS

    (

    SELECT 1,'Mary'...

  • RE: Averages over 28 days instead of a month

    Raastarr (1/4/2016)


    Thanks for all of the responses.

    I've gone with the first solution from Eirikur as it did exactly what was required :-).

    You are very welcome and thanks for the feedback.

    😎

  • RE: Why Scalar Functions Can Be Costly

    Thank you Mickey for this article, good Monday morning reading.

    The part I find hard to agree with is "When to Use Scalar Functions", particularly when the example given can easily...

  • RE: Averages over 28 days instead of a month

    Jeff Moden (1/3/2016)


    Now would be a good time to shift the train of thought to ISO Weeks, which always start the year in the week that Jan 4th occurs. ...

  • RE: Averages over 28 days instead of a month

    Good job with the DDL and the sample data Raastarr, made this very quick and straight forward question to answer;-)

    😎

    There are few ways of doing this, here is the first...

  • RE: query for datetime

    Timing the different methods using the previously posted test data set

    😎

    Test harness

    -- TEST: Different ways of calculating duration

    -- DATA SET: ...

  • RE: Using User Defined functions with SQL Window operations

    This is not possible in this way, the over clause cannot be used with user defined functions.

    😎

  • RE: query for datetime

    Jeff Moden (1/1/2016)


    Eirikur Eiriksson (12/31/2015)


    Careful here Jeff, the type cast to decimal is expensive, consider using float which does not need a type cast is less costly.

    Understood. FLOAT only...

Viewing 15 posts - 4,096 through 4,110 (of 8,753 total)