Forum Replies Created

Viewing 15 posts - 616 through 630 (of 1,228 total)

  • RE: Enhance the query to read the organization ID from organization table instead of listing the organization ID in WHERE clause

    No problem - take "c.data_view = 'BASE' " out of the WHERE clause and put it back into the CASE statements.


    [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: Enhance the query to read the organization ID from organization table instead of listing the organization ID in WHERE clause

    Cool, that's good so far. Thanks for posting the results.

    You can get rid of the "extra rows" by using a simple aggregate:

    SELECT DISTINCT

    org_id = a.organization,

    org_name = a.name,

    TB...


    [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: Enhance the query to read the organization ID from organization table instead of listing the organization ID in WHERE clause

    yingchai (1/13/2012)


    Hi ChrisM@home,

    Removing the WHERE clause does not help. It still throws the same error...

    Msg 8152, Level 16, State 14, Line 9

    String or binary data would be truncated.

    The statement has...


    [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: Enhance the query to read the organization ID from organization table instead of listing the organization ID in WHERE clause

    Ooops sorry my mistake - you want to check that [Organization] exists in the Organization_table.

    Firstly, can you try this alternative to the existing code? I don't think you need...


    [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: Enhance the query to read the organization ID from organization table instead of listing the organization ID in WHERE clause

    yingchai (1/13/2012)


    ....By looking at the script above, I had hard coded the four organization ID in the WHERE clause (line 14 to line 17). How can I modify the script...


    [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: Recusion on Group and their subGroups- how can I solve this problem?

    Since the query above resolves out children from parents, you first have to resolve the parents of the groups you want to pass in:

    ;WITH

    Groups AS (

    SELECT GroupId = g.Id,...


    [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: Returning a column per date in a range

    Evil Kraig F (1/12/2012)


    nick-1043370 (1/12/2012)


    Speaking for myself I'd rather get something, work out whether it works in the context of the problem, and then re-pose the question if necessary. If...


    [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: Alternatives to LIKE and FTS for mid name search

    sjimmo (1/12/2012)


    Peter

    What is the contents of the @phonenum variable?

    The variable contains a telephone number. In this case, it could be a cell, home or work phone. The reason for 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: exclude certain entries but not all when something is found

    You're welcome.

    Can I recommend to you the link in my sig "please read this"? It's quite funny, and it's helpful for new forum members too.

    Cheers

    ChrisM


    [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: exclude certain entries but not all when something is found

    I think that's the same as this:

    Select i.name as Server, fd.path

    FROM dbo.Inv_Installed_File_Details fd

    JOIN vComputer i ON i.Guid = fd._ResourceGuid

    WHERE fd.name = 'ESRDEF.BIN' and Path not like '%BinHub'

    AND (

    (i.[OS Name]...


    [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: exclude certain entries but not all when something is found

    lawson2305 (1/12/2012)


    can you be more specific on what you mean? by CASE?

    I'm researching case now if I find something I will respond regarding this.

    Not without a clearer idea 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: Are the posted questions getting worse?

    GSquared (1/12/2012)


    Brandie Tarvin (1/12/2012)


    GilaMonster (1/12/2012)


    Bex (1/12/2012)


    From someone who is a lurker on this site, I take the attitude that if I ask for free help and I don't like 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: Returning a column per date in a range

    SQL Kiwi (1/12/2012)


    Jeff and Chris,

    You've missed the point I was making, and have chosen to assume that I am either (a) not aware of the performance issues involved; or (b)...


    [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: Returning a column per date in a range

    Jeff Moden (1/12/2012)


    SQL Kiwi (1/11/2012)


    It's pretty tough to imagine a list of dates long enough to make any practical difference regarding performance here. Before anyone says it, yes I...


    [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: Question for the "experts"

    DeanORenO (1/11/2012)


    you people on this forum are always complaining about the questions that are asked on the forums, either you complain that they are too simple, and that the poster...


    [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 - 616 through 630 (of 1,228 total)