Are the posted questions getting worse?

  • This is a rant, too be honest.  Other than syntactical differences, what is different between the following two queries:

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left join [ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

  • Lynn Pettis - Wednesday, October 31, 2018 1:30 PM

    This is a rant, too be honest.  Other than syntactical differences, what is different between the following two queries:

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left join [ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    Not sure what you are looking for. The only logical difference I see is that the first one joins to a remote table and the second joins to a local table with the same name. Is there something else?

    _______________________________________________________________

    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 - Wednesday, October 31, 2018 1:45 PM

    Lynn Pettis - Wednesday, October 31, 2018 1:30 PM

    This is a rant, too be honest.  Other than syntactical differences, what is different between the following two queries:

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left join [ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    Not sure what you are looking for. The only logical difference I see is that the first one joins to a remote table and the second joins to a local table with the same name. Is there something else?

    Tables in the local database could have different data types than the one in the remote database.  The statistics could be different, as could the indexing on the tables involved.  Then there's the server-level stuff like the plan cache, data in the buffer pool, memory available, etc.  Is this the type of stuff you're looking for?  Other than that type of stuff, I don't see it.

  • Ed Wagner - Wednesday, October 31, 2018 1:52 PM

    Tables in the local database could have different data types than the one in the remote database.  The statistics could be different, as could the indexing on the tables involved.  Then there's the server-level stuff like the plan cache, data in the buffer pool, memory available, etc.  Is this the type of stuff you're looking for?  Other than that type of stuff, I don't see it.

    also -I'd expect dramatically worse performance on the "split server" query.  Depending on what's on the remote end, performing the a join of 2 remote tables on the same remote server would usually push the execution to happen remotely and have the results come back.  Unless you're really lucky the local/remote query will tend to pull the ENTIRE remote table locally then join it, without any indexes of course  (so double ding on the perf side).

    Edit:  since your WHERE clause purely tags the remote table, you might care to push your WHERE clause into a subquery you call "a"

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Lynn Pettis - Wednesday, October 31, 2018 1:30 PM

    This is a rant, too be honest.  Other than syntactical differences, what is different between the following two queries:

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left join [ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    I gave up on those threads.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • That feeling when you're trying to figure out how to take a basic bit of code someone gave you (Thank you again Phil Parkin!) and get it to work for you.
    With no C# experience...
    And you don't want to go back to your topic with a "it doesn't work" reply and no attempt at getting it to work...
    :Whistling:
    (And no, this isn't a "please help me Phil, you're my only hope" I'm stubborn and *WILL* figure this out.)

  • Lynn Pettis - Wednesday, October 31, 2018 1:30 PM

    This is a rant, too be honest.  Other than syntactical differences, what is different between the following two queries:

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left join [ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    Both have horrifying naming standards that will lead to confusion as more tables get introduced and or various different tables are named [a] or . Other than that, the four part name.

    "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 - Wednesday, October 31, 2018 2:36 PM

    Lynn Pettis - Wednesday, October 31, 2018 1:30 PM

    This is a rant, too be honest.  Other than syntactical differences, what is different between the following two queries:

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    select
        [a].[co_num]
        , .[cust_po]
        , [a].[co_line]
        , [a].[co_release]
        , [a].[item]
        , [a].[u_m]
        , [a].[qty-ordered]
        , [a].[whse]
        , .[cust_seq]
        , .[ship_code]
    from
        [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
        left join [ESS_app].[dbo].[co] as
            on [a].[co_num] = .[co_num]
    where
        [a].[co_num] not like '%q0%'
        and [a].[co_line] = 1
    order by
        [a].[co_num] desc;
    go

    Both have horrifying naming standards that will lead to confusion as more tables get introduced and or various different tables are named [a] or . Other than that, the four part name.

    For everyone, the second query didn't work but the first did.  The OP couldn't see the difference either.

  • So...
    If someone's wife woke them up at 3am when they had to get up for work at 6am, because the toilet kept running, and the someone couldn't really get back to sleep after having to get up, turn the light on, take the top of the tank off, lift the float 1/8" so it would shut off, would they be legally in the clear if they woke her up at 7am on her day off and wouldn't let her go back to sleep?

    Asking for a friend...
    :doze:

  • jasona.work - Thursday, November 1, 2018 4:57 AM

    So...
    If someone's wife woke them up at 3am when they had to get up for work at 6am, because the toilet kept running, and the someone couldn't really get back to sleep after having to get up, turn the light on, take the top of the tank off, lift the float 1/8" so it would shut off, would they be legally in the clear if they woke her up at 7am on her day off and wouldn't let her go back to sleep?

    Asking for a friend...
    :doze:

    My "friend" told me that from experience this is perfectly acceptable from their perspective, as they did with this their other half the last month. Apparently their other half was less than pleased, but we're just talking about the friends here. :hehe:

    Thom~

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

  • Thom A - Thursday, November 1, 2018 5:04 AM

    jasona.work - Thursday, November 1, 2018 4:57 AM

    So...
    If someone's wife woke them up at 3am when they had to get up for work at 6am, because the toilet kept running, and the someone couldn't really get back to sleep after having to get up, turn the light on, take the top of the tank off, lift the float 1/8" so it would shut off, would they be legally in the clear if they woke her up at 7am on her day off and wouldn't let her go back to sleep?

    Asking for a friend...
    :doze:

    My "friend" told me that from experience this is perfectly acceptable from their perspective, as they did with this their other half the last month. Apparently their other half was less than pleased, but we're just talking about the friends here. :hehe:

    Jason, you might be legally in the clear, but that doesn't matter.  You have to ask yourself if doing so and making your point is really worth it.

  • jasona.work - Thursday, November 1, 2018 4:57 AM

    So...
    If someone's wife woke them up at 3am when they had to get up for work at 6am, because the toilet kept running, and the someone couldn't really get back to sleep after having to get up, turn the light on, take the top of the tank off, lift the float 1/8" so it would shut off, would they be legally in the clear if they woke her up at 7am on her day off and wouldn't let her go back to sleep?

    Asking for a friend...
    :doze:

    Do not do it. Just sayin'.

    "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 - Thursday, November 1, 2018 5:11 AM

    Jason, you might be legally in the clear, but that doesn't matter.  You have to ask yourself if doing so and making your point is really worth it.

    So tempting...
    So very, very tempting...

  • jasona.work - Thursday, November 1, 2018 4:57 AM

    So...
    If someone's wife woke them up at 3am when they had to get up for work at 6am, because the toilet kept running, and the someone couldn't really get back to sleep after having to get up, turn the light on, take the top of the tank off, lift the float 1/8" so it would shut off, would they be legally in the clear if they woke her up at 7am on her day off and wouldn't let her go back to sleep?

    Asking for a friend...
    :doze:

    Sure, as long as you share the results.

  • ZZartin - Thursday, November 1, 2018 8:36 AM

    jasona.work - Thursday, November 1, 2018 4:57 AM

    So...
    If someone's wife woke them up at 3am when they had to get up for work at 6am, because the toilet kept running, and the someone couldn't really get back to sleep after having to get up, turn the light on, take the top of the tank off, lift the float 1/8" so it would shut off, would they be legally in the clear if they woke her up at 7am on her day off and wouldn't let her go back to sleep?

    Asking for a friend...
    :doze:

    Sure, as long as you share the results.

    As an architect I would adivse that you consider both the short-term AND long-term consequences of said actions 🙂  And by you I mean "your firend" of course 🙂

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 15 posts - 62,791 through 62,805 (of 66,815 total)

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