Viewing 15 posts - 31 through 45 (of 47 total)
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.
May 24, 2017 at 1:39 pm
SELECT * FROM OLD
EXCEPT
SELECT * FROM NEW;
To:
May 18, 2017 at 2:33 pm
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....
May 17, 2017 at 2:33 pm
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.
November 2, 2016 at 12:42 pm
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...
October 11, 2016 at 3:12 pm
I edited and added the comma. Sorry. Current result is
EffectiveDateHolderHQuantityTQuantityPercentage
2001-01-01John 10 10 100
2001-01-02John ...
September 19, 2016 at 11:40 am
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...
September 19, 2016 at 11:34 am
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%...
September 19, 2016 at 11:33 am
Everything needed is there in [font="Courier New"]courier new[/font]!
September 19, 2016 at 10:09 am
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...
September 14, 2016 at 1:37 pm
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.
September 13, 2016 at 1:40 pm
The sample actually includes this case. John has 2 transactions as of 2001-01-01.
September 12, 2016 at 2:33 pm
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...
September 12, 2016 at 9:56 am
I am getting deadlocks (SqlException 1205). I understand that my test case is highly hypothetical but I wanted to have deadlocks for sure.
August 5, 2014 at 6:53 am
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...
August 4, 2014 at 2:40 pm
Viewing 15 posts - 31 through 45 (of 47 total)