Forum Replies Created

Viewing 15 posts - 2,806 through 2,820 (of 5,502 total)

  • RE: Multi-column, single result aggregation

    What I'd basically do is to move the decision whether to use securityID1 or securityID2 into a CASE statement instead of a UNION to avoid running a table scan/seek more...



    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: Multi-column, single result aggregation

    Would that be an easy baseline?

    SELECT

    Acct_ID,

    SUM( CASE WHEN Category IN ( 'a', 'bdq', 'rr') THEN Value1

    ...



    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: Loop calendar table and delete rows

    Try to write a query to select all rows from PeoplesCalender that should be deleted (use an inner join on PersonID and a WHERE clause to limit PeoplesCalender.date>Leavers.DateLeft).

    Once you verified...



    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: D: drive is full and transaction log is full

    Maybe a stupid question:

    Would it help to detach the other DB's (assuming that option is available) and move the related mdf and ldf files to a different drive/server to free...



    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: Need help in this query

    ... and here's the version to include the total amount right after the last month, based on the sample posted before.

    ;

    WITH cte AS

    (

    SELECT

    ID,

    N+1 AS Pos,

    STUFF(CONVERT(CHAR(11),DATEADD(mm,N,start_date),0),4,6,'''') AS col1,

    total_amt/total_month...



    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: Need help in this query

    Jeff Moden (9/15/2010)


    LutzM (9/15/2010)


    ...

    I absolutely agree with what you say but consider the following... what if there is no "front end" for this task?? 😉 Remember... to a nail,...



    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: Need help in this query

    The requested output is not really something you should expect from a SQL statement:

    a) It seems like you want to have "flexible column names" for each row which is totally...



    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: Are the posted questions getting worse?

    Craig Farrell (9/15/2010)


    CirquedeSQLeil (9/15/2010)


    Steve Jones - Editor (9/15/2010)


    Once that guy got outside the caged area, my stomach was flip flopping. Struggled to watch, and then was stunned again when he...



    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: Are the posted questions getting worse?

    Gianluca Sartori (9/15/2010)


    Alvin Ramard (9/15/2010)


    Steve Jones - Editor (9/15/2010)


    And on an unrelated note. Who wants this job?

    http://www.youtube.com/watch?v=txdv_oNq81I&feature=youtu.be

    Not the kind of job I'd want.

    I had to stop it after 2...



    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: Changing from INSERT INTO...SELECT (with a UNION) to SELECT INTO

    I think the best I can recommend at this point is to get someone in to help those 3rd party folks improving their software asap. If there is such 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]

  • RE: Are the posted questions getting worse?

    Lynn Pettis (9/14/2010)


    I'm guessing not many will jump to help bit boy if he runs into more trouble and posts a question on SSC again (if he does post again).

    Based...



    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: To insert data only if it doesnot exist if exist show the table info and print a message

    You should still get the inserted message when successful.

    The square bracket issue is weird. Possible any "non-standard" column names? (e.g. including space, comma or any other fancy stuff?)



    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: Good to do list manager

    Brandie Tarvin (9/14/2010)


    Oh, I'm going to have to look into both of those. Glad I read this post.

    EDIT: Do either of these have some sort of alarm or notification broadcast...



    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: To insert data only if it doesnot exist if exist show the table info and print a message

    avi-631555 (9/14/2010)


    Basically i am trying to accomplish

    Inserting data into a table only if it doesnot exist and if does to show me the content of the table and...



    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: sum by each quarter

    Seems like a related issue posted here...



    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 - 2,806 through 2,820 (of 5,502 total)