Are the posted questions getting worse?

  • Hugo Kornelis - Friday, October 20, 2017 4:55 AM

    Sean Lange - Thursday, October 19, 2017 3:30 PM

    Oh how I love third party databases. I have been working with this one off and on and am always surprised that the table I am looking at doesn't have a primary key so just for giggles I ran these two queries.


    select count(*) from sys.tables
    select count(*) from sys.indexes where type_desc = 'HEAP'

    tables = 495
    heaps = 433

    And people wonder why this system is so slow. :crying:

    Nitpicking, I know - but a primary key can also be implemented with a nonclustered index. So in theory (and I am really talking theory here) it is still possible that all those 433 have a nice nonclustered primary key on them.... :crazy:

    Theory? I'm sure you saw our tables.

    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 - Friday, October 20, 2017 10:49 AM

    Hugo Kornelis - Friday, October 20, 2017 4:55 AM

    Sean Lange - Thursday, October 19, 2017 3:30 PM

    Oh how I love third party databases. I have been working with this one off and on and am always surprised that the table I am looking at doesn't have a primary key so just for giggles I ran these two queries.


    select count(*) from sys.tables
    select count(*) from sys.indexes where type_desc = 'HEAP'

    tables = 495
    heaps = 433

    And people wonder why this system is so slow. :crying:

    Nitpicking, I know - but a primary key can also be implemented with a nonclustered index. So in theory (and I am really talking theory here) it is still possible that all those 433 have a nice nonclustered primary key on them.... :crazy:

    Theory? I'm sure you saw our tables.

    Heh I knew on this system those guys weren't that "clever". I have used the front end and it is bad enough, the backend is truly scary.

    _______________________________________________________________

    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/

  • Still here I see.

    "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

  • Grant Fritchey - Saturday, October 21, 2017 2:06 PM

    Still here I see.

    Where else would we be?

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • ThomasRushton - Sunday, October 22, 2017 10:02 AM

    Grant Fritchey - Saturday, October 21, 2017 2:06 PM

    Still here I see.

    Where else would we be?

    We all might've moved over to StackOverflow, or maybe /r/DBA...

  • jasona.work - Monday, October 23, 2017 5:19 AM

    ThomasRushton - Sunday, October 22, 2017 10:02 AM

    Grant Fritchey - Saturday, October 21, 2017 2:06 PM

    Still here I see.

    Where else would we be?

    We all might've moved over to StackOverflow, or maybe /r/DBA...

    Not much chance of that.

  • Grant Fritchey - Saturday, October 21, 2017 2:06 PM

    Still here I see.

    Does this mean that you are back from your sabbatical?

    What all did you do?

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • WayneS - Monday, October 23, 2017 4:04 PM

    Grant Fritchey - Saturday, October 21, 2017 2:06 PM

    Still here I see.

    Does this mean that you are back from your sabbatical?

    What all did you do?

    I am back and on the road to Connections. I'll see you at Summit next week I hope. 

    Tons of stuff. #1 was three weeks in Germany.

    "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

  • Grant Fritchey - Monday, October 23, 2017 5:11 PM

    WayneS - Monday, October 23, 2017 4:04 PM

    Grant Fritchey - Saturday, October 21, 2017 2:06 PM

    Still here I see.

    Does this mean that you are back from your sabbatical?

    What all did you do?

    I am back and on the road to Connections. I'll see you at Summit next week I hope. 

    Tons of stuff. #1 was three weeks in Germany.

    Nice.  Do you feel refreshed and inspired, like you're just back from sabbatical?
    The real question, of course, is about how many emails you had in your inbox. 😛

    I know when I take any time off at all, my inbox blows up.  It's almost like when sharks smell blood in the water get into a frenzy.  It causes people to send more email asking why I haven't responded to their email.  The OOO was clearly not enough so they have to send more email.

  • Ed Wagner - Monday, October 23, 2017 5:35 PM

    Nice.  Do you feel refreshed and inspired, like you're just back from sabbatical?
    The real question, of course, is about how many emails you had in your inbox. 😛

    I know when I take any time off at all, my inbox blows up.  It's almost like when sharks smell blood in the water get into a frenzy.  It causes people to send more email asking why I haven't responded to their email.  The OOO was clearly not enough so they have to send more email.

    I had an auto-delete on everything for my work email along with a message saying it was getting nuked. Ha!

    "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

  • Grant Fritchey - Tuesday, October 24, 2017 6:39 AM

    Ed Wagner - Monday, October 23, 2017 5:35 PM

    Nice.  Do you feel refreshed and inspired, like you're just back from sabbatical?
    The real question, of course, is about how many emails you had in your inbox. 😛

    I know when I take any time off at all, my inbox blows up.  It's almost like when sharks smell blood in the water get into a frenzy.  It causes people to send more email asking why I haven't responded to their email.  The OOO was clearly not enough so they have to send more email.

    I had an auto-delete on everything for my work email along with a message saying it was getting nuked. Ha!

    SPOM! ROFLMAO!  I was sure that I was the only one that ever did such a thing. 😀

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

  • Looks like a Son of Silver Spoon has disappeared because he didn't get the answers to both questions.  Not getting any response today.

  • Jeff Moden - Tuesday, October 24, 2017 7:42 AM

    Grant Fritchey - Tuesday, October 24, 2017 6:39 AM

    I had an auto-delete on everything for my work email along with a message saying it was getting nuked. Ha!

    SPOM! ROFLMAO!  I was sure that I was the only one that ever did such a thing. 😀

    I used to do this periodically with the pile on my desk. People would drop work off, or I'd print emails. Once it got more than an inch or so thick, I'd throw everything below the top few items in the trash. Clearly I was never going to pop that work off the stack.

  • So, several years ago a contractor wrote a rather involved 'temporary' query against a third-party database that we have no control over - and of course it is still in use today. There is a bug in said query and I was asked to look at it several months ago, whenever I had nothing better to do.
    The third-party database has no foreign keys, no documentation, no constraints and inconsistent column names (columns that have the same information/purpose in different tables may not have the same, or similar names). All of the logic appears to be in the front end, and the third-party isn't sharing that.
    This hasn't been my favourite task and until recently I was having no success at all. With the help of one of the developers on my team (whom I would put up against all of the third-party's bunch) I have had an epiphany and I can see the cause of the bug.
    We use SQL 2012 and I have written a wonderful and simple piece of code, using LEAD and LAG, to correct the data. I can insert it into the original code without interfering with any of the logic already there.
    It is a thing of beauty and I feel sufficiently smug.
    And then I realise they have their database on 2008.

    Yes, I should have checked and probably did way back when I first looked, but moved some of the data onto my servers and promptly forgot.

    I need a word to describe this feeling - I've run out of expletives (and I know quite a few).

  • Steve, I feel your pain! Damn shame you can't use the windowing functions in 2008. I seem to use them more and more for simplifying problems.

    I had the complete opposite situation last year at a company. Most of the dbs were 2008 R2, but one was 2012 or 2014. My fellow Dev had a nasty little task set which using FIRST_VALUE was trivial to do. But he wasn't too familiar with windowing functions. I spotted the server was 2012 (or 2014) gave him the solution the next morning... Worked like a dream.

    Except, all the overnight build was run via third party app that had its own t-sql interpreter (yep no SSIS here or sql jobs running T-sql) and it was only up to 2008...

    "It doesn't work for the over night build" I was told the day after...
    "Oh I reply, why not stick the code in a stored procedure and call that from the build job..."
    Result. I had to say I was really glad it did, tricky to solve without FIRST_VALUE ! I would have had to post the problem on the forums 🙂

    Rodders...

    Edit: It was FIRST_VALUE not LEAD that saved the day!

Viewing 15 posts - 60,181 through 60,195 (of 66,738 total)

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