Forum Replies Created

Viewing 15 posts - 4,246 through 4,260 (of 5,502 total)

  • RE: Temporal Query Problem

    Ok, now we have 214 SELECT statements. I'm guessing we could wrap those into a statement like

    Select * into claim_statuses from (...)a

    We still don't have definition and sample data...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: If Else Statment Syntax Error

    Did you actually try to figure out what the error message is telling you?

    If you can't find anything wrong after the if statement in line 10 the reason might be...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: can't print the value of a local variable

    Lynn Pettis (2/16/2010)


    Easy, the cause is the following lines:

    SET @Jun30Date = CAST('06/30/' + cast(year(@Report_From) as varchar(4)) as datetime)

    ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: can't print the value of a local variable

    There is no value assigned to variable @CPU_String.

    This will cause @String2 to be null (adding NULL to a value will result in NULL again).

    Therefore, your complete SQL statement @SQLSubmit will...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Rows having records of a perticular type

    Ash-N (2/15/2010)


    That's a good one. No this is not a H/W Question.

    We have a case where we need to get all the records which has a specific criteria. I had...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: concatinating many records into one row

    Jeff Moden (2/15/2010)


    deveringham (2/15/2010)


    Hi Lutz

    The updated code worked a treat (first time) - thank you

    Dougal

    The next question would be, do you understand how it works and could you use it...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Dynamic Query generation

    FANINDRA BHORTAKKE (2/15/2010)


    Thanks again lmu92 for your help,

    I tried the following solution ....

    So what did you get as results when compared to the solution I recommended?

    And, if both solutions return...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: concatinating many records into one row

    You're welcome!

    Sometimes a working (and maybe even faster) solution is simple but we just can't find it... Been there, done that. 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Rows having records of a perticular type

    Sounds like a homework question....

    If yes: what specific question do you have? We usually don't do someone's homework, but we'll be happy to assist you if you got stuck...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: concatinating many records into one row

    Wouldn't the following code give you the same result?

    It should perform a lot better than what you have so far...

    Also, you should consider changing the data type for tmp_restrict [NOTETEXT]...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Return dafault values when no rows returned

    Use a Numbers/Tally table or a calendar table to get the weeks you'd like to see as the left part of a left join and use ISNULL() function for weeks...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Dynamic Query generation

    Ok, here's what I came up with based on the sample data.

    I'm not sure if it works under all circumstances... Maybe the CASE statements have to be tuned further.

    Furthermore I...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: concatinating many records into one row

    Would you mind providing some descriptive sample data together with table def and expected result?

    To me it looks like it's not required at all to build those concatenated strings just...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Insert value using XML

    Well, it's up to you whether you want to store the data 😉

    My recommendation was to take the select I provided in my last post to fill a temp table...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Temporal Query Problem

    Step one (increase performance):

    Since you do a self join on your cte you actually perform your three-table-join twice.

    Maybe it's more efficient to store the result of your cte into a...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 4,246 through 4,260 (of 5,502 total)