Are the posted questions getting worse?

  • WayneS (11/17/2015)


    Ed Wagner (11/16/2015)


    WayneS (11/16/2015)


    Lynn Pettis (11/13/2015)


    (think government contracted software development).

    My scary story when working with the gov't.

    Software contract awarded, specified that all data access has to go through stored procedures.

    They sent to me for my approval:

    CREATE PROCEDURE xyz (

    @ColumnList varchar(max),

    @From varchar(max),

    @Where varchar(max),

    @Order varchar(max)

    )

    AS

    declare @command varchar(max);

    SET @command = 'SELECT ' + @ColumnList + ' FROM ' + @From;

    IF @Where > '' SET @command = @command + ' WHERE ' + @Where;

    IF @Order > '' SET @command = @command + ' ORDER BY ' + @Order;

    EXECUTE (@command);

    GO

    Yep, that was the only procedure in the application.

    They quickly learned to hate me.

    That would be extraordinarily funny if it weren't true. Unfortunately, I have this feeling that you aren't joking.

    Nope, not joking at all.

    That is what we used to call "Malicious Compliance" and extremely high velocity pork was normally expressed to the perpetrators.

    --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)

  • Jeff Moden (11/17/2015)


    jasona.work (11/17/2015)


    I love it when I'm poking through topics that sound interesting, and come across something I've not done / seen before. Which then leads me down a rabbit hole to figure out (sometimes) *how* to do the thing in the topic...

    Case in point:

    How to do a PIVOT led me down the rabbit hole of how to do a crosstab instead of a pivot...

    So I converted a query I had, that was using PIVOT, to a crosstab. No performance gains (it's just a different way for me to check and display last backups for all my DBs, so not a lot of data,) but in some ways it's an easier to read query...

    So, to paraphrase Neo "The One:" "I know crosstabs"

    :hehe:

    "It Depends". There's usually an minor performance gain in using CROSSTABs over PIVOTs but it's so small on today's machines, it's nearly trivial... unless... if the CROSSTAB or PIVOT is truly an aggregation, then pre-aggregation will help a whole lot and CROSSTAB (in such a case) will we roughly twice as fast at PIVOT.

    For more information and some test code, please see the following article.

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    As a personal preference, I prefer CROSSTABs rather than PIVOTs just from a readability point of view.

    I also wouldn't call learning something new a "rabbit hole" no matter how cleverly disguised nor how deep the hole may be. 😀

    That's actually the article I looked at to sort out how to do a crosstab.

    Nah, for me learning something new is a rabbit hole, because I start out looking up how to do a crosstab and end up having taught myself how to speak Klingon...

    :hehe:

  • WayneS (11/16/2015)


    Lynn Pettis (11/13/2015)


    (think government contracted software development).

    My scary story when working with the gov't.

    Software contract awarded, specified that all data access has to go through stored procedures.

    They sent to me for my approval:

    CREATE PROCEDURE xyz (

    @ColumnList varchar(max),

    @From varchar(max),

    @Where varchar(max),

    @Order varchar(max)

    )

    AS

    declare @command varchar(max);

    SET @command = 'SELECT ' + @ColumnList + ' FROM ' + @From;

    IF @Where > '' SET @command = @command + ' WHERE ' + @Where;

    IF @Order > '' SET @command = @command + ' ORDER BY ' + @Order;

    EXECUTE (@command);

    GO

    Yep, that was the only procedure in the application.

    They quickly learned to hate me.

    Holy...

    Well, you won the Internet today as far as I'm concerned.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Ed Wagner (11/17/2015)


    Lynn Pettis (11/16/2015)


    Ed Wagner (11/16/2015)


    Lynn Pettis (11/16/2015)


    And then you this type of question:

    ************(11/16/2015)


    How can i round off decimal number. E.g if i have 7.9---i need to round it off to 8, if i have 7.4---i need to round it off to 7...i tried round, ceiling.. but nothing got worked... please suggest

    I gave it a shot. We'll see if the shiny thing in my office is the crystal ball making an appearance or merely the sun beckoning me to go outside.

    At least you have sunshine. Looks like snowy weather is coming here for here.

    I saw that major snowstorm, but it looked like the brunt of hit was going to hit east of you. How did it turn out?

    I think our turn is coming here soon enough. Yesterday was in the 60s and this weekend we're supposed to struggle to get up to 40 and see the first snow of the year. The timing is about right.

    North side of town got more. Down here on the south side, some snow but a lot of ice. Yesterday as the storm hit my boss said we could work from home, come in, or take PTO. I was going to head, still may in the afternoon depending on the weather.

  • OMG

  • Lynn Pettis (11/17/2015)


    OMG

    Resume time.

  • Lynn Pettis (11/17/2015)


    OMG

    Step 1: Prepare 3 envelopes. :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 (11/17/2015)


    Lynn Pettis (11/17/2015)


    OMG

    Step 1: Prepare 3 envelopes. :hehe:

    ROFL.

    _______________________________________________________________

    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 (11/17/2015)


    Luis Cazares (11/17/2015)


    Lynn Pettis (11/17/2015)


    OMG

    Step 1: Prepare 3 envelopes. :hehe:

    ROFL.

    I thought step 3 was to prepare 3 envelopes.

  • 8am yesterday

    3pm yesterday

    8am today

  • Send some of that snow my way, Steve?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • djj (11/17/2015)


    Lynn Pettis (11/17/2015)


    OMG

    Resume time.

    Not touching that one with a ten foot pole.

    Someone is probably getting fired.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Ed Wagner (11/17/2015)


    Sean Lange (11/17/2015)


    Luis Cazares (11/17/2015)


    Lynn Pettis (11/17/2015)


    OMG

    Step 1: Prepare 3 envelopes. :hehe:

    ROFL.

    I thought step 3 was to prepare 3 envelopes.

    It's too late for that. Unless someone wants to share knowledge on DBCC TIMEWARP with that poor OP, then it might be too soon for that.

    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
  • Steve, your feet are conspicuously absent from the last photo. Bit chilly or so relaxed they're just buried in the snow?! 😛

  • Steve,

    Please send the sun east, but keep the snow.

Viewing 15 posts - 51,466 through 51,480 (of 66,712 total)

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