Forum Replies Created

Viewing 15 posts - 1,441 through 1,455 (of 5,502 total)

  • RE: Query Tuning which uses a self join

    It depends.

    Depending on the data structure the following code might return the same result:

    SELECT sub.Count,F.*

    FROM

    Table F

    INNER JOIN

    ...



    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 average from last 12 month with 0 possible

    I'm confident this link will help you getting started on the calendar table concept.



    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: updating several tables and deleting the original rows

    Before I post my solution: You did an EXCELLENT JOB describing the scenario and providing ready to use sample data! There's nothing better to ask for! GREAT!!

    And here's what 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: Find out who dropped a table in a db that's in simple mode.

    SkyBox (6/1/2011)


    ...

    Thanks Lowell, that was the ticket! FYI - the developer that asked about the missing table was the culprit.

    There are some bets where one can almost always win....



    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 getting highest 2 PO numbers per Part

    First and most important question: are you sure you're using SQL Server 2000 and not 2005 or 2008 version? It's important because since SQL Server 2005 it's been a lot...



    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: count occurrences of unique 2 column combination

    lgonzales 69796 (6/1/2011)


    sorry, but I don't see a difference than from what I posted.

    you only ommitted the dbo.propdb in front of the table names.

    I aliased the tables to improve readability...



    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: slow query uses nested loop and clustered index seek, but hint for hash join is much faster

    It seems like the statistics are out of date. If you compare estimated and actual number of rows, there's a big difference.

    The other reason for the first query taking...



    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: accidental DBA needing help

    You're using the table name only in your join predicate: table1.acctnumber = table2.acctnumber

    But those table names are interpreted as being local tables.

    The easiest would be to assign an alias to...



    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: TSQL Count by Week - Show Period

    I kindly ask you to read my latest reply just to be aware of the trouble you might run into when using wk or dw together with DATEPART()...



    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: count occurrences of unique 2 column combination

    Since I don't have any table def and sample data this is just a guess. Close enough?

    SELECT

    UMMTR.DISTRICT,

    UMMTR.RATETYPE,

    TRNCD.DESCRIPT,

    UMMTR.XSIZE,

    UMSIZ.DESCRIPT AS SIZEDESC,

    ...



    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: TSQL Count by Week - Show Period

    I strongly vote against using DATEPART(wk,...) or DATEPART(dw,...) since it depends on the setting of @@DATEFIRST, which in turn can be modified by a different language setting.

    And all of...



    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: SSIS job error

    Google is your friend in this case:

    I searched for "The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020" and the first result...



    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: TSQL Count by Week - Show Period

    Something like this?

    SELECT COUNT(task_id) AS cnt,DATEPART(isowk,create_time) AS ISO_wk,YEAR(create_time) AS Yr

    FROM Tasks

    GROUP BY YEAR(create_time),DATEPART(isowk,create_time)

    Since you didn't define the start of a week I jus assume you'll follow the ISO definition.

    If not,...



    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: Deadlock Issue

    If this process is as complex as you describe and you can't narrow it down to a few queries I'd recommend to get a consultant in analyzing your system. 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?

    I recently took the test for CUI (on a test system, of course). But due to the sheer amount and the excellent taste of the liquor served, it rapidly turned...



    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 - 1,441 through 1,455 (of 5,502 total)