Viewing 15 posts - 5,521 through 5,535 (of 5,684 total)
WRACK (9/20/2010)
September 20, 2010 at 12:17 am
This isn't pretty, but it works:
SELECT MatrixName, [MON] AS 'MON', [TUE] AS 'TUE', [WED] AS 'WED', [THU] AS 'THU', [FRI] AS 'FRI', [TODAY] AS 'TODAY'
, [mon]+[tue]+[wed]+[thu]+[fri]+[today] AS SumCnt, ([mon]+[tue]+[wed]+[thu]+[fri]+[today])/6 AS...
September 19, 2010 at 11:59 pm
I felt nice... and yes, that's what I was looking for. 🙂
CREATE TABLE #Rolling5Summary
(MatrixOrderINT,
MatrixNameVARCHAR(50),
OriginalDateDATETIME,
[DayOfWeek]VARCHAR(50),
TotalCountINT
)
GO
INSERT INTO #Rolling5Summary
SELECT 1,'Mail In',CAST( '08/16/2010' AS DATETIME ), 'MON', 540 UNION ALL
SELECT 1,'Mail In',CAST( '08/17/2010' AS...
September 19, 2010 at 11:46 pm
Since you didn't post the execution plan, I'll ask the next question. 🙂
Is there a difference in the execution plans between the two queries when you run them? Devil...
September 19, 2010 at 11:31 pm
phil.layzell (9/19/2010)
This worked fine in 2000;
"(@ReferenceNumber is NULL OR ( ISNUMERIC(P.ReferenceNumber) >...
September 19, 2010 at 11:15 pm
swethak13 (9/19/2010)
September 19, 2010 at 11:05 pm
My preference has, and almost always will be, SPROC if there's logic involved if I can get away with it. Primarily so that I only have to re-deploy a...
September 19, 2010 at 11:01 pm
BarkingDog, the reason Jeff's solution is better then mine/ours is speed. His update method gets in and out in one action, whereas the select/update pair takes two. You...
September 19, 2010 at 8:40 pm
Jeff Moden (9/19/2010)
Heh... I'm just a step behind you on my posts...
I've got the advantage, I'm west coast, so it's not beddie bye time for me yet, so I'm still...
September 19, 2010 at 8:22 pm
Jeff Moden (9/19/2010)
September 19, 2010 at 8:17 pm
Barkingdog (9/19/2010)
Jeff,My solution is the same as yours except I used:
SELECT @return= NextID FROM seqNum with (UPDLOCK)
Actually, that was me. Jeff's solution is much more elegant.
September 19, 2010 at 8:15 pm
Ah, that makes sense, you're avoiding the necessity of the double call by using the running total method that's undocumented.
Btw, if you force the tablockx, you won't get...
September 19, 2010 at 8:14 pm
Jeff Moden (9/19/2010)
At any rate, the WORST thing you could possibly do is use a...
September 19, 2010 at 7:18 pm
You should be able to build a maintenance plan to do all that for you, and then automate it via SQL Agent.
September 19, 2010 at 7:14 pm
Viewing 15 posts - 5,521 through 5,535 (of 5,684 total)