Are the posted questions getting worse?

  • Lynn Pettis - Wednesday, September 27, 2017 9:56 AM

    drew.allen - Wednesday, September 27, 2017 9:50 AM

    The first form won't even parse (in 2014).  Aliases can only be defined in the FROM clause, not the UPDATE clause.  Perhaps you are confusing it with this form:
    UPDATE dbo.SomeTable
    SET SomeColA = ot.SomeColA
    FROM dbo.SomeTable st
    INNER JOIN OtherTable ot
        ON st.SomePK = ot.SomePK

    In this form, they are referencing SomeTable twice: once unaliased in the UPDATE clause and once aliased in the FROM clause.

    Drew

    I have had issues at times with this form, had to replace the unaliased table name after the UPDATE statement with the alias from the table in the FROM clause.

    Same here.

  • Ed Wagner - Wednesday, September 27, 2017 9:16 AM

    Sean Lange - Wednesday, September 27, 2017 7:18 AM

    Jason A. Long - Tuesday, September 26, 2017 8:59 PM

    Beatrix Kiddo - Tuesday, September 26, 2017 2:45 AM

    oSounds like it's below your skillset, Jason.

    Sorry to ask, but is anybody here able to help me with my Availability Group puzzler here please?

    We do use AO/AG but I my direct involvement with the implementation has been pretty minimal to date, I was brought in after the fact to create a solution to keep CDC up and running in the event of a fail-over from primary to secondary...
    Assuming, tomorrow has a more relaxed pace than today, I'll I'll dig into the backup process and see what we're doing with AG.

    We had a guy in here a few years ago who wrote a new system using Entity Framework. He had heard that I was pretty good with sql and optimizing queries so he asked me if I could help him with a query that was running through EF. I of course told him I would happy to help. He then delivered a query that was somewhere around 1,000 lines and had no less than around 70-80 subqueries. He was kind of frustrated that I couldn't make his query faster. I told him I could but it would require starting from scratch and an explanation of what the query was attempting to do because the abomination that EF generated was never going to work. I doubt any automated code generating tool will ever be as good as human. The whole thing about coding is that is almost as much art as it is science. You can write code to handle the science part but that art part requires a human brain to process.

    I couldn't agree more, Sean.  Going back to the VB5 days and continuing through the View Designer :sick: in SSMS, I've never seen a code generator or wizard generate good code that I'd consider using in production.  That's not to say that one doesn't exist or couldn't be written; just that I've never seen one.

    I think a big part of the problem, at least with SQL, is that we're initially led to believe something along these line... "SQL is declarative language. You simply use a set of commands to ask your question (query) in a language that's pretty close to plain English and the system's optimizer will decipher it and decide, all on it's own, how best to satisfy your request".  Which would imply that the exact phrasing of your query doesn't really matter, as long as it's both logically and syntactically correct... Or, in other words, any two queries that are logically equivalent, are going to produce the exact same result set and would, therefore, produce the same back end execution plan.

    Most of us know, that's not entirely true... We know that how we choose to phrase our queries has a very real impact on the decisions being made by the optimizer. 

    ORMs and code generators seem to reinforce that initial fallacy by giving the user the impression that all they have to do is provide a "logically correct" request and the mysterious black box will properly sort out the details. 
    Add the fact that these tools are designed for use by people who don't have a lot of knowledge regarding the underlying language or the impact that various code patterns have on the optimizer... :crazy:

  • Finally caught up on the last couple of months of the 'Thread', as I had got behind.

    In summary;

    Congratulations Brandie, wonderful news.

    Cheers,

    Rodders...

  • Apparently, we got an Oracle fan that likes to resurrect things, like 7 year old threads or his 7 year old account.

    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 - Thursday, September 28, 2017 9:08 AM

    Apparently, we got an Oracle fan that likes to resurrect things, like 7 year old threads or his 7 year old account.

    He also resurrected a 10 year old thread.  Everyone is entitled to their opinion.  Having worked with Oracle, I prefer SQL Server.

  • Lynn Pettis - Thursday, September 28, 2017 9:11 AM

    Luis Cazares - Thursday, September 28, 2017 9:08 AM

    Apparently, we got an Oracle fan that likes to resurrect things, like 7 year old threads or his 7 year old account.

    He also resurrected a 10 year old thread.  Everyone is entitled to their opinion.  Having worked with Oracle, I prefer SQL Server.

    They are, but they've pasted the same thing in every single post (4 times). If they truly wanted to sell Oracle then you'd hope that would provide a much more compelling debate than "Oracle is better. I have been inside its databases, and it is great." 🙂

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A - Thursday, September 28, 2017 9:19 AM

    Lynn Pettis - Thursday, September 28, 2017 9:11 AM

    Luis Cazares - Thursday, September 28, 2017 9:08 AM

    Apparently, we got an Oracle fan that likes to resurrect things, like 7 year old threads or his 7 year old account.

    He also resurrected a 10 year old thread.  Everyone is entitled to their opinion.  Having worked with Oracle, I prefer SQL Server.

    They are, but they've pasted the same thing in every single post (4 times). If they truly wanted to sell Oracle then you'd hope that would provide a much more compelling debate than "Oracle is better. I have been inside its databases, and it is great." 🙂

    Exactly, an assertion like that is closer to spam than to an actual debate.

    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
  • Thom A - Thursday, September 28, 2017 9:19 AM

    Lynn Pettis - Thursday, September 28, 2017 9:11 AM

    Luis Cazares - Thursday, September 28, 2017 9:08 AM

    Apparently, we got an Oracle fan that likes to resurrect things, like 7 year old threads or his 7 year old account.

    He also resurrected a 10 year old thread.  Everyone is entitled to their opinion.  Having worked with Oracle, I prefer SQL Server.

    They are, but they've pasted the same thing in every single post (4 times). If they truly wanted to sell Oracle then you'd hope that would provide a much more compelling debate than "Oracle is better. I have been inside its databases, and it is great." 🙂

    Just asked him for his comparison points as one might learn something new 😀
    😎

  • Eirikur Eiriksson - Thursday, September 28, 2017 9:36 AM

    Just asked him for his comparison points as one might learn something new 😀
    😎

    I will be very (pleasantly) surprised if you get a response to that post.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • He has been a lurker since 2010 and his 4 posts today are his first.

  • Jason A. Long - Wednesday, September 27, 2017 11:19 AM

    Ed Wagner - Wednesday, September 27, 2017 9:16 AM

    Sean Lange - Wednesday, September 27, 2017 7:18 AM

    Jason A. Long - Tuesday, September 26, 2017 8:59 PM

    Beatrix Kiddo - Tuesday, September 26, 2017 2:45 AM

    oSounds like it's below your skillset, Jason.

    Sorry to ask, but is anybody here able to help me with my Availability Group puzzler here please?

    We do use AO/AG but I my direct involvement with the implementation has been pretty minimal to date, I was brought in after the fact to create a solution to keep CDC up and running in the event of a fail-over from primary to secondary...
    Assuming, tomorrow has a more relaxed pace than today, I'll I'll dig into the backup process and see what we're doing with AG.

    We had a guy in here a few years ago who wrote a new system using Entity Framework. He had heard that I was pretty good with sql and optimizing queries so he asked me if I could help him with a query that was running through EF. I of course told him I would happy to help. He then delivered a query that was somewhere around 1,000 lines and had no less than around 70-80 subqueries. He was kind of frustrated that I couldn't make his query faster. I told him I could but it would require starting from scratch and an explanation of what the query was attempting to do because the abomination that EF generated was never going to work. I doubt any automated code generating tool will ever be as good as human. The whole thing about coding is that is almost as much art as it is science. You can write code to handle the science part but that art part requires a human brain to process.

    I couldn't agree more, Sean.  Going back to the VB5 days and continuing through the View Designer :sick: in SSMS, I've never seen a code generator or wizard generate good code that I'd consider using in production.  That's not to say that one doesn't exist or couldn't be written; just that I've never seen one.

    I think a big part of the problem, at least with SQL, is that we're initially led to believe something along these line... "SQL is declarative language. You simply use a set of commands to ask your question (query) in a language that's pretty close to plain English and the system's optimizer will decipher it and decide, all on it's own, how best to satisfy your request".  Which would imply that the exact phrasing of your query doesn't really matter, as long as it's both logically and syntactically correct... Or, in other words, any two queries that are logically equivalent, are going to produce the exact same result set and would, therefore, produce the same back end execution plan.

    Most of us know, that's not entirely true... We know that how we choose to phrase our queries has a very real impact on the decisions being made by the optimizer. 

    ORMs and code generators seem to reinforce that initial fallacy by giving the user the impression that all they have to do is provide a "logically correct" request and the mysterious black box will properly sort out the details. 
    Add the fact that these tools are designed for use by people who don't have a lot of knowledge regarding the underlying language or the impact that various code patterns have on the optimizer... :crazy:

    My favorite(worst) example of this is still Filemaker, which if you ever used it has a tightly coupled database/GUI interface.  The resulting scripting language is A) almost entirely done through a pointy clicky interface B) mostly just macros for GUI commands.  That's not to say it can't be very effective when used properly, when not used properly, ie when business users realize how easily can poorly right their own scripts it results in some interesting things 😛

  • Is anyone going to SQL Saturday Pittsburgh this weekend?
    If anyone's going to be there, it would be nice to meet a fellow Threadizen and put a face with the name.

    Pittsburgh is, without a doubt, the best SQL Saturday I've ever attended.  They just put on a great event.

  • ZZartin - Thursday, September 28, 2017 11:23 AM

    Jason A. Long - Wednesday, September 27, 2017 11:19 AM

    Ed Wagner - Wednesday, September 27, 2017 9:16 AM

    Sean Lange - Wednesday, September 27, 2017 7:18 AM

    Jason A. Long - Tuesday, September 26, 2017 8:59 PM

    Beatrix Kiddo - Tuesday, September 26, 2017 2:45 AM

    oSounds like it's below your skillset, Jason.

    Sorry to ask, but is anybody here able to help me with my Availability Group puzzler here please?

    We do use AO/AG but I my direct involvement with the implementation has been pretty minimal to date, I was brought in after the fact to create a solution to keep CDC up and running in the event of a fail-over from primary to secondary...
    Assuming, tomorrow has a more relaxed pace than today, I'll I'll dig into the backup process and see what we're doing with AG.

    We had a guy in here a few years ago who wrote a new system using Entity Framework. He had heard that I was pretty good with sql and optimizing queries so he asked me if I could help him with a query that was running through EF. I of course told him I would happy to help. He then delivered a query that was somewhere around 1,000 lines and had no less than around 70-80 subqueries. He was kind of frustrated that I couldn't make his query faster. I told him I could but it would require starting from scratch and an explanation of what the query was attempting to do because the abomination that EF generated was never going to work. I doubt any automated code generating tool will ever be as good as human. The whole thing about coding is that is almost as much art as it is science. You can write code to handle the science part but that art part requires a human brain to process.

    I couldn't agree more, Sean.  Going back to the VB5 days and continuing through the View Designer :sick: in SSMS, I've never seen a code generator or wizard generate good code that I'd consider using in production.  That's not to say that one doesn't exist or couldn't be written; just that I've never seen one.

    I think a big part of the problem, at least with SQL, is that we're initially led to believe something along these line... "SQL is declarative language. You simply use a set of commands to ask your question (query) in a language that's pretty close to plain English and the system's optimizer will decipher it and decide, all on it's own, how best to satisfy your request".  Which would imply that the exact phrasing of your query doesn't really matter, as long as it's both logically and syntactically correct... Or, in other words, any two queries that are logically equivalent, are going to produce the exact same result set and would, therefore, produce the same back end execution plan.

    Most of us know, that's not entirely true... We know that how we choose to phrase our queries has a very real impact on the decisions being made by the optimizer. 

    ORMs and code generators seem to reinforce that initial fallacy by giving the user the impression that all they have to do is provide a "logically correct" request and the mysterious black box will properly sort out the details. 
    Add the fact that these tools are designed for use by people who don't have a lot of knowledge regarding the underlying language or the impact that various code patterns have on the optimizer... :crazy:

    My favorite(worst) example of this is still Filemaker, which if you ever used it has a tightly coupled database/GUI interface.  The resulting scripting language is A) almost entirely done through a pointy clicky interface B) mostly just macros for GUI commands.  That's not to say it can't be very effective when used properly, when not used properly, ie when business users realize how easily can poorly right their own scripts it results in some interesting things 😛

    This whole topic got me thinking back to when I first started trying to write SQL having come from MS Access and it's GUI... I'm soooo. glad I never found the query designer in SSMS, because I had no idea what constituted either good or bad SQL back then. Had I known a gui interface existed, there's a chance I would never been forced to hand code. Having no one to teach me is what brought me here in the 1st place (I think I was a member for close to 3 years before I made my first post).

  • Ed Wagner - Thursday, September 28, 2017 12:24 PM

    Is anyone going to SQL Saturday Pittsburgh this weekend?
    If anyone's going to be there, it would be nice to meet a fellow Threadizen and put a face with the name.

    Pittsburgh is, without a doubt, the best SQL Saturday I've ever attended.  They just put on a great event.

    Trying to decide if I should put money aside and go to SQL Saturday in Providence, RI in December.  I would get to spend a day with my daughter before the event by going out there on a Thursday.

Viewing 15 posts - 60,016 through 60,030 (of 66,712 total)

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