Forum Replies Created

Viewing 15 posts - 1,261 through 1,275 (of 5,502 total)

  • RE: Converting money to varchar still gives me the values in my result set. HELP~~!

    Did you try

    WHERE A.CashPurse1 < > 0



    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: Inserting millions of rows into a partitioned view

    Just as a side note: instead of

    WHERE DATEPART(YEAR,DateColumn)=2009

    I'd rather recommend use

    WHERE DateColumn>='20090101' AND DateColumny'20100101'

    The original version won't benefit from a (hopefully) existing index on DateColumn.



    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 with inner joins

    It's hard to troubleshoot without having the table defs referenced by the sproc.

    You might need to run the code with defiined parameter instead of calling the sproc with input variables....



    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 with inner joins

    I think there's a little more to change...

    Change the block before the comment -- Execute SQL statement

    SET @sqlStatement = @sqlStatement + @whereSql + '

    )

    SELECT * FROM PaymentViewPaged

    WHERE RowIndex between @PageIndex...



    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 with inner joins

    Ninja's_RGR'us (7/14/2011)


    Not needed anymore.

    Lutz finally understood the quoting system.

    NO. :-P:-D

    :hehe:



    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 with inner joins

    @ninja: I edited the quote range in my reply. You might need to adjust yours to reflect that, too 😀



    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: Help Needed for to Improve SQL Query Performance

    I just removed the GROUP BY as well as the CONVERT() function. The result is still identical:

    SELECTDISTINCT OM.ID,Sequence

    FROM #DataHistory OM

    OUTER APPLY

    (

    SELECT

    STUFF((

    SELECT ',' + LTRIM(RTRIM(O.Letter ))

    FROM #DataHistory...



    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 with inner joins

    Matt Miller (#4) (7/14/2011)


    According to that - since you're dynmiacally building the query, so definitely don't need the function in the JOIN. Instead - use the parameter differently:

    SELECT *...



    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: Subquery Running Slow

    Start with comparing the actual execution plans if both are exactly the same.



    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 with inner joins

    krypto69 (7/14/2011)


    So I'm guessing that this is a dynamic parameter and not static value

    yep I talked to the dev again and he said it was a dynamic parameter..so they...



    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: Subquery Running Slow

    Almost impossible to answer based on the information provided so far.

    Parameter sniffing? Out of date statistics? Missing/dropped indexes? Changed data volume? Heavy server load? Disc issues? ...

    Please remember: neither do...



    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: Week Grand Total not equal to sum across 7 days

    I am perplexed, can summing up of DISTINCT COUNT aggregated measure from day level to week be a reason for this?

    It depends.

    What do you expect to be a valid 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: problem query

    run the inner query separately:

    SELECT wrhid

    FROM (

    (SELECT wrkID, MAX(wrhid) as wrhid

    FROM tblWerknemerHistorie

    WHERE wrkID in (SELECT wrh.wrkid

    FROM dbTR_20110708.dbo.vwWerknemers WRK

    INNER JOIN dbTR_20110708.dbo.tblWerknemerHistorie WRH on...



    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 with inner joins

    Ninja's_RGR'us (7/13/2011)


    We all agree on that Lutz but...

    krypto69 (7/13/2011)


    I talked to the dev and he says he must use that function -

    So I'm guessing that this is a dynamic parameter...



    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 with inner joins

    Or even just

    WHERE PC.[PaymentStatus] IN ('AM','P','VR')



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