Are the posted questions getting worse?

  • GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The coalesce on the other hand is for people who have never heard of IS NOT NULL πŸ˜€

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The coalesce on the other hand is for people who have never heard of IS NOT NULL πŸ˜€

    In TSQL that would be

    WHERE COMPREHEND(NULL) IS NULL

    😎

  • Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The coalesce on the other hand is for people who have never heard of IS NOT NULL πŸ˜€

    Nevermind the column can't be null.:-D:-D

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (7/9/2014)


    Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The coalesce on the other hand is for people who have never heard of IS NOT NULL πŸ˜€

    Nevermind the column can't be null.:-D:-D

    You never know, you might find something like this:

    CREATE TABLE Categories(

    CategoryID NVARCHAR(MAX) NULL,

    NotNullableColumn NVARCHAR(MAX) NULL)

    I'm sure that someone is capable of doing something like that. :w00t:

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares (7/9/2014)


    SQLRNNR (7/9/2014)


    Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The coalesce on the other hand is for people who have never heard of IS NOT NULL πŸ˜€

    Nevermind the column can't be null.:-D:-D

    You never know, you might find something like this:

    CREATE TABLE Categories(

    CategoryID NVARCHAR(MAX) NULL,

    NotNullableColumn NVARCHAR(MAX) NULL)

    I'm sure that someone is capable of doing something like that. :w00t:

    U U U UGLY

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The actual query was a little (lot) more complex and the group by was completely unnecessary. Whether the optimiser couldn't figure that out or what I don't know, but it was resulting in a sort being added to the plan.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • SQLRNNR (7/9/2014)


    Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The coalesce on the other hand is for people who have never heard of IS NOT NULL πŸ˜€

    Nevermind the column can't be null.:-D:-D

    That doesn't matter. It might be used to filter out rows after a left outer join. (although I can imagine more efficient constructs)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • GilaMonster (7/9/2014)


    Koen Verbeeck (7/9/2014)


    GilaMonster (7/9/2014)


    WHERE Coalesce(NotNullableColumn,-1) = 0

    and CategoryID = @CategoryID

    Group By CategoryID

    ......

    Imo there is not necessarily something wrong with the group by.

    The actual query was a little (lot) more complex and the group by was completely unnecessary.

    I can imagine the actual query being more complex (also having a SELECT and stuff like that :-D).

    I was thinking along the lines of aggregations, but then probably other columns should have been included in the GROUP BY as well.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • So I tried to endorse Jeff on LinkedIn for BCP, but somehow it doesn't work.

    I saw Jeff was endorsed 9 times for SSIS. That was cruel. πŸ˜€

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (7/10/2014)


    So I tried to endorse Jeff on LinkedIn for BCP, but somehow it doesn't work.

    I saw Jeff was endorsed 9 times for SSIS. That was cruel. πŸ˜€

    I don't know, I bet Jeff would write better SSIS packages than a lot of people who do it full-time.:w00t:

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • Jack Corbett (7/10/2014)


    Koen Verbeeck (7/10/2014)


    So I tried to endorse Jeff on LinkedIn for BCP, but somehow it doesn't work.

    I saw Jeff was endorsed 9 times for SSIS. That was cruel. πŸ˜€

    I don't know, I bet Jeff would write better SSIS packages than a lot of people who do it full-time.:w00t:

    I guess he would have just one Execute SQL Task that calls a stored procedure πŸ˜€

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (7/10/2014)


    Jack Corbett (7/10/2014)


    Koen Verbeeck (7/10/2014)


    So I tried to endorse Jeff on LinkedIn for BCP, but somehow it doesn't work.

    I saw Jeff was endorsed 9 times for SSIS. That was cruel. πŸ˜€

    I don't know, I bet Jeff would write better SSIS packages than a lot of people who do it full-time.:w00t:

    I guess he would have just one Execute SQL Task that calls a stored procedure πŸ˜€

    So would I - you wouldn't believe the cr@p SSIS tasks I've seen in the last couple of years. Gazillions of DCT's just because some oaf couldn't write decent TSQL.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • I get it. I'm not the brightest bulb in the box, but I can usually understand the logic of processing data most of the time. I'm utterly at a loss over here. Maybe this guy is making sense and I'm just too dense to understand. Maybe it's gibberish like it feels like. Maybe I'm tired. Could someone, nicely, try to help here?

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Koen Verbeeck (7/10/2014)


    Jack Corbett (7/10/2014)


    Koen Verbeeck (7/10/2014)


    So I tried to endorse Jeff on LinkedIn for BCP, but somehow it doesn't work.

    I saw Jeff was endorsed 9 times for SSIS. That was cruel. πŸ˜€

    I don't know, I bet Jeff would write better SSIS packages than a lot of people who do it full-time.:w00t:

    I guess he would have just one Execute SQL Task that calls a stored procedure πŸ˜€

    Reminds me of a package I recently fixed that had the following.

    Execute SQL task that executed a stored procedure, that called xp_cmdshell, executed a bat file, that executed sqlcmd that queried a table for a single value.

    Yeah go figure.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Grant Fritchey (7/10/2014)


    I get it. I'm not the brightest bulb in the box, but I can usually understand the logic of processing data most of the time. I'm utterly at a loss over here. Maybe this guy is making sense and I'm just too dense to understand. Maybe it's gibberish like it feels like. Maybe I'm tired. Could someone, nicely, try to help here?

    Nope you are spot on. It is total gibberish and the poor person doesn't know enough to realize how screwed up their "structures" are. I would have answered but about all I would do is say much the same as you, except I might add that they should hire a consultant to help them unravel that mess.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 15 posts - 44,566 through 44,580 (of 66,000 total)

You must be logged in to reply to this topic. Login to reply