Viewing 15 posts - 1,141 through 1,155 (of 1,244 total)
If neither script is working for you, you may need to post some representative test data... Otherwise we're just stabbing around in the dark.
June 19, 2015 at 7:48 am
I may have simply misunderstood the problem (or my test data set may not be indicative of the actual data set in question) but I didn't get the expected results...
June 18, 2015 at 4:06 pm
helal.mobasher 13209 (6/18/2015)
1. I think there was a missing close parentheses in this statement right before ROWS. I added that.
\MAX(fgs.rn) OVER (ORDER BY fgs.DT, fgs.BegTime, fgs.ClientID)...
June 18, 2015 at 2:45 pm
Here's another solution... I haven't tested it against Dohsan's solution, so I can't tell you which will perform better.
(This vast majority of the cost on the following is in sorts......
June 18, 2015 at 1:54 pm
ChrisM@Work (6/4/2015)
Jason A. Long (6/4/2015)
ChrisM@Work (6/4/2015)
Jason A. Long (6/4/2015)
Edit... I didn't like the solution I posted...Solution to what? 😀
It was just a rewrite of the original code Sales.Customer code.
I didn't...
June 4, 2015 at 12:02 pm
ChrisM@Work (6/4/2015)
Jason A. Long (6/4/2015)
Edit... I didn't like the solution I posted...Solution to what? 😀
It was just a rewrite of the original code Sales.Customer code.
I didn't like it... So I...
June 4, 2015 at 8:04 am
TheSQLGuru (6/1/2015)
Thanks for that Jason!
No problem. Thanks for kicking me in the back side to get it done... With the data partition and the select output. 😀
When I want to...
June 1, 2015 at 8:19 pm
As promised... Something a little closer to "real life"... Select outputs rather than updates and a a partition has been added to the data.
Here is the new(ish) test table...
/* ================================================================
Create...
June 1, 2015 at 7:18 pm
TheSQLGuru (5/31/2015)
1) Main one is that you are putting NULL into the running total column to start. You KNOW you are creating fragementation with page splits. So why didn't...
May 31, 2015 at 10:54 am
Anyone see any flaws in this version? I think I've got the bases covered, but I'd feel better with a 2nd set of eyes...
/* ================================================================
Create a simple 1M test table...
May 30, 2015 at 6:55 pm
Jeff Moden (5/30/2015)
May 30, 2015 at 1:41 pm
TheSQLGuru (5/30/2015)
May 30, 2015 at 10:42 am
My default answer for that question, for the last few years, has been to start by picking up a copy on "Microsoft SQL Server 2012 T-SQL Fundamentals" by Itzik Ben-Gan.
May 30, 2015 at 6:34 am
Thanks Jeff - I appreciate your help. I just wish I knew what I'm doing to trigger the spam detector...
It doesn't like 2 posts from the same poster, back...
May 29, 2015 at 9:59 pm
Viewing 15 posts - 1,141 through 1,155 (of 1,244 total)