Are the posted questions getting worse?

  • Hugo Kornelis (1/4/2017)


    Note that both for the versions in your post as well as for the versions given by Eirikur, only some work correctly for nullable columns.

    I don't think any of them really work 'correctly' for NULLs in the data, I mean none are going to return just the rows where Col IS NULL when a NULL is passed.

    I'll add a comment to the blog post mentioning that I'm only dealing with NOT NULL columns (the alternative is far more complicated that I ever want to deal with)

    I consider all of these to be bad ideas.

    Likewise.

    Another pattern that I have used is

    IF @C1 IS NOT NULL

    BEGIN;

    SET @Qry += ' AND Col1 = @C1';

    END;

    (...)

    EXEC sp_executesql @Qry, '@C1', @C1;

    That one at least performs well. πŸ™‚

    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
  • GilaMonster (1/4/2017)


    Hugo Kornelis (1/4/2017)


    Note that both for the versions in your post as well as for the versions given by Eirikur, only some work correctly for nullable columns.

    I don't think any of them really work 'correctly' for NULLs in the data, I mean none are going to return just the rows where Col IS NULL when a NULL is passed.

    True. But some of them at least return all data when a NULL is passed in; others return only the non-NULL values.

    Usually, for this type of dynamic search criteria is to return everything when NULL is passed in and matches when something else is passed, so the former would qualify as "correct" by that definition.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (1/4/2017)


    GilaMonster (1/4/2017)


    Hugo Kornelis (1/4/2017)


    Note that both for the versions in your post as well as for the versions given by Eirikur, only some work correctly for nullable columns.

    I don't think any of them really work 'correctly' for NULLs in the data, I mean none are going to return just the rows where Col IS NULL when a NULL is passed.

    True. But some of them at least return all data when a NULL is passed in; others return only the non-NULL values.

    Good point. I'll flag the ones that don't behave correctly.

    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
  • Testing and bug fixes for the forum upgrade is going well.

    Right now we have a final test release set for Tues, Jan 10 and the final deployment for early UK time on Thur, Jan 12.

  • Steve Jones - SSC Editor (1/4/2017)


    Testing and bug fixes for the forum upgrade is going well.

    Right now we have a final test release set for Tues, Jan 10 and the final deployment for early UK time on Thur, Jan 12.

    That is great news. Thanks to you and the whole team that have been working on this. πŸ˜€

    _______________________________________________________________

    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/

  • Sean Lange (1/4/2017)


    Steve Jones - SSC Editor (1/4/2017)


    Testing and bug fixes for the forum upgrade is going well.

    Right now we have a final test release set for Tues, Jan 10 and the final deployment for early UK time on Thur, Jan 12.

    That is great news. Thanks to you and the whole team that have been working on this. πŸ˜€

    Yes, really good news. Thanks for the investment of time and effort. I know it was significant. Here's to a good release. πŸ™‚

  • Does anyone have any idea why a thread I created yesterday

    http://www.sqlservercentral.com/Forums/FindPost1847804.aspx

    appears to have removed or marked as spam?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin (1/5/2017)


    Does anyone have any idea why a thread I created yesterday

    http://www.sqlservercentral.com/Forums/FindPost1847804.aspx

    appears to have removed or marked as spam?

    Maybe you were selling kitchens? Or fake documents? :hehe:

    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 (1/5/2017)


    Phil Parkin (1/5/2017)


    Does anyone have any idea why a thread I created yesterday

    http://www.sqlservercentral.com/Forums/FindPost1847804.aspx

    appears to have removed or marked as spam?

    Maybe you were selling kitchens? Or fake documents? :hehe:

    Dammit, I was going to use those links to the cricket streams you posted.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    β€”Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Luis Cazares (1/5/2017)


    Phil Parkin (1/5/2017)


    Does anyone have any idea why a thread I created yesterday

    http://www.sqlservercentral.com/Forums/FindPost1847804.aspx

    appears to have removed or marked as spam?

    Maybe you were selling kitchens? Or fake documents? :hehe:

    Of course not. It was a totally valid question about optimising the retrieval of cash from Nigerian bank accounts.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin (1/5/2017)


    Of course not. It was a totally valid question about optimizing the retrieval of cash from Nigerian bank accounts.

    Thanks I needed a good laugh. :laugh:

    Head cold today so I am feeling bad, so this helped.

  • Phil Parkin (1/5/2017)


    Luis Cazares (1/5/2017)


    Phil Parkin (1/5/2017)


    Does anyone have any idea why a thread I created yesterday

    http://www.sqlservercentral.com/Forums/FindPost1847804.aspx

    appears to have removed or marked as spam?

    Maybe you were selling kitchens? Or fake documents? :hehe:

    Of course not. It was a totally valid question about optimising the retrieval of cash from Nigerian bank accounts.

    I can only guess someone reported something, or there was a mistake. We try to hide and not delete SPAM, but perhaps someone made a mistake.

    Apologies.

  • Ed Wagner (1/4/2017)


    Sean Lange (1/4/2017)


    Steve Jones - SSC Editor (1/4/2017)


    Testing and bug fixes for the forum upgrade is going well.

    Right now we have a final test release set for Tues, Jan 10 and the final deployment for early UK time on Thur, Jan 12.

    That is great news. Thanks to you and the whole team that have been working on this. πŸ˜€

    Yes, really good news. Thanks for the investment of time and effort. I know it was significant. Here's to a good release. πŸ™‚

    Awesome news. I agree. Thanks for taking the time for the improvements! I just don't know what they are, yet. πŸ˜€

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Quick random question that isn't really worthy of its own thread. Given that the log redo process in an AlwaysOn Availability Group secondary can be likened to a continuous restore, how are we able to read the database, given that it's not conveniently going into Standby when we need it to. Is just because of the snapshot isolation level?

    I know it probably sounds obvious, but I don't want to assume anything. Thanks.

  • Beatrix Kiddo (1/9/2017)


    Quick random question that isn't really worthy of its own thread. Given that the log redo process in an AlwaysOn Availability Group secondary can be likened to a continuous restore, how are we able to read the database, given that it's not conveniently going into Standby when we need it to. Is just because of the snapshot isolation level?

    I know it probably sounds obvious, but I don't want to assume anything. Thanks.

    MS Magic.

    They control the process, so you are essentially in standby.

Viewing 15 posts - 57,031 through 57,045 (of 66,712 total)

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