Forum Replies Created

Viewing 15 posts - 31 through 45 (of 47 total)

  • RE: CTE and UNION performance issue

    Luis,

    I tried you statement (I put a TOP 5 to limit the results!) and it does not return StartDate and EndDate, it rather returns the StartDate twice. 

  • RE: Performance issue with EXCEPT

    I just found out a magic key. If I change the end of the first script from:

    SELECT * FROM OLD
    EXCEPT
    SELECT * FROM NEW;

    To:

  • RE: Performance issue with EXCEPT

    Thanks Jacob,

    Both old functions and new functions are iTVFs (new functions use CTE). I could send you the plans which are actually complex since the functions are themselves complex....

  • RE: WITH INDEX hint

    I did update the stats while my statement was oversimplified and it had a positive effect. But with my original statement, the performance remained poor.

  • RE: Performance issue when testing the value of ROW_NUMBER in a WHERE clause

    The plans are quite similar.

    The more I am analyzing this, the more it appears to be a SQL Manager Studio issue. I just discovered that if, within Manager Studio, I...

  • RE: Getting rid of cursors

    I edited and added the comma. Sorry. Current result is

    EffectiveDateHolderHQuantityTQuantityPercentage

    2001-01-01John 10 10 100

    2001-01-02John ...

  • RE: Getting rid of cursors

    J Livingston SQL,

    My real data is more complex than the sample data I post with my examples. In the first example you referred to, quantity was the actual sum of...

  • RE: Getting rid of cursors

    Drew,

    Sorry, you're right. I over-simplified thinking it would help. Here's something bigger:

    INSERT INTO @Transactions (EffectiveDate, Holder, Quantity) VALUES

    ( '2001-01-01', 'John', 5 ),

    ( '2001-01-01', 'John', 5 ), --John Holds 100%...

  • RE: Getting rid of cursors

    Everything needed is there in [font="Courier New"]courier new[/font]!

  • RE: Transform transactions into report without using cursors

    With the given dataset your solution gives the exact same result. With different datasets I sometimes get slightly different results but I am fixing it as I am learning new...

  • RE: Transform transactions into report without using cursors

    I have 2014 installed on my local computer. My clients have 2008 and up. If the right solution requires some clients to upgrade then it will be done! Thanks.

  • RE: Running totals on different columns

    The sample actually includes this case. John has 2 transactions as of 2001-01-01.

  • RE: Running totals on different columns

    Writing

    SUM(Quantity) OVER (ORDER BY EffectiveDate RANGE UNBOUNDED PRECEDING) AS TQuantity

    does the trick. I will have to learn more about this feature as I currently have the bad feeling of programming...

  • RE: Deadlock handling performance

    I am getting deadlocks (SqlException 1205). I understand that my test case is highly hypothetical but I wanted to have deadlocks for sure.

  • RE: Deadlock handling performance

    I am running the threads on a client machine and each thread uses its own SqlConnection component. As far as I know, this is equivalent of having several computers running...

Viewing 15 posts - 31 through 45 (of 47 total)