Forum Replies Created

Viewing 15 posts - 121 through 135 (of 1,228 total)

  • RE: CASE Assistance

    SUM() OVER() would preserve rows.


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: OUTER JOIN Not Producing Non Existent Record with IS NULL

    ChrisM@Work (8/19/2015)


    serviceaellis (8/18/2015)


    Please see attached.

    The worksheet is the result that needs to be produced with the highlighted row.

    in the Access file the two tables are:

    1. PersonMembership - with all the...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Long running Select Query

    coolchaitu (8/18/2015)


    Datatype of te.TripEndTime. You had asked what is the datatype of te.TripEndTime.

    It wasn't clear.

    You should change the datatype to datetime as a matter of priority.

    Did you run the...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Long running Select Query

    coolchaitu (8/18/2015)


    Its datatype is varchar

    Datatype of what?


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Should I go Contracting in South West England?

    The south east appears to be still quite bouyant after a peak in June/July. There used to be a lot of activity based around Exeter but I haven't seen any...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Issue returning unique rows

    Your result set shows two different photo id's for the same user id. Try using APPLY to return a single row from the photos table, like this:

    SELECT

    p.Id [SenderId],

    p.Username,...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query Execution plan too long

    thenewbee (7/22/2015)


    Hi All,

    I am working on a legacy application and one of the view has degraded performance. I have to fix it,

    but the query execution makes me mad as it...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query Execution plan too long

    thenewbee (7/26/2015)


    Attached a test plan, Is it possible to avoid the table scan & clustered index scan in this scenario

    Yes. Create covering indexes for both tables, something like this:

    CREATE INDEX...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Using a Recursive CTE to Generate a List

    Eirikur Eiriksson (6/28/2015)


    ChrisM@home (6/28/2015)


    This is about the simplest rCTE that I can think of. No 8k pages anywhere yet Statistics IO reports logical reads:

    SET STATISTICS IO ON;

    WITH rCTE AS (

    SELECT...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Using a Recursive CTE to Generate a List

    This is about the simplest rCTE that I can think of. No 8k pages anywhere yet Statistics IO reports logical reads:

    SET STATISTICS IO ON;

    WITH rCTE AS (

    SELECT n = 1

    UNION...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Using a Recursive CTE to Generate a List

    dfischer 36834 (6/26/2015)


    Very interesting. However, the stated result was for a comma delimeted countyID not countyName. When I changed countyName to CountyID I got a conversion error. Not sure why.

    Try...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Is is possible to Dynamic join on EXECUTE table column

    pjn (6/23/2015)


    Not sure? if this is ever going to be possible, but I'm trying to do a dynamic join on EXECUTE, but the execution string has to come from a...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Eliminating a Distinct SORT operation

    lmarkum (6/19/2015)


    I have an UPDATE statement that joins two table by SendId. One table, I'll call it T1, has a clustered index on SendId ASC. The other table...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: SQL query

    GilaMonster (6/4/2015)


    ChrisM@Work (6/4/2015)


    spectra (6/4/2015)


    Ok. not an issue. Is it possible to write this in pure SQL way ? (so that I don't face database migration issue later)

    My...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Update Statement and Case Statement

    dwilliscp (6/4/2015)


    Is there a way to use a case statement after "SET"? I am currently getting the following..

    Msg 156, Level 15, State 1, Line 2

    Incorrect syntax near the keyword 'case'.

    My...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

Viewing 15 posts - 121 through 135 (of 1,228 total)