Viewing 15 posts - 31,636 through 31,650 (of 59,102 total)
Sergiy (12/20/2011)
http://www.sqlservercentral.com/articles/Test+Data/61572/
It's from the same author, so should be as useful.
🙂
Check the outcome generated in The "Hog" Test.
Just export 2 columns generated by the query to comma...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2011 at 7:39 pm
Hi Mattie,
Thank you for the very nice feedback and for posting your code.
Nope. @RowCounter doesn't keep things from "going into a loop". @RowCounter makes sure that the order...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2011 at 7:14 pm
Thanks, Hai.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2011 at 6:59 pm
SQLJocky (12/19/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 9:23 pm
David Moutray (12/19/2011)
bteraberry (12/19/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 9:12 pm
Michael Valentine Jones (12/19/2011)
SELECT TOP 1
a.f1
FROM
(
SELECT TOP 2
b.f1
FROM
tmp2nd b
ORDER BY
b.f1 ASC
) a
ORDER BY
a.f1 DESC
Heh... on of my favorites for "paging" code. 🙂 You left out @LinesPerPage = 1, @Page...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 8:56 pm
Just a couple of notes:
1. The clustered index contained columns that didn't matter.
2. You had two orphaned variables that did nothing in the code. I removed...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 7:44 pm
Stefan Krzywicki (12/19/2011)
GSquared (12/19/2011)
Stefan Krzywicki (12/19/2011)
Revenant (12/19/2011)
bitbucket-25253 (12/19/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 10:51 am
Revenant (12/19/2011)
bitbucket-25253 (12/19/2011)
. . . Being too darn lazy perfrom the necessary calculations required for rocket engine design by using my slide rule. . . .
Yes, we are...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 10:49 am
VIG (12/19/2011)
Jeff Moden (12/19/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 10:44 am
Just thought I'd throw these in... they get rid of the behind-the-scenes operation of parenthetical grouping and remove one extra subtraction (for the month end calculation) for a tiny bit...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 7:22 am
VIG (12/18/2011)
declare @y intdeclare @m int
select @y=2012,@m=2
select dateadd(month,(@y-1900)*12+@m,0)-1
Because there's no string conversions in that, that's one of the fastest was to do this... nicely done.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2011 at 7:09 am
I absolutely agree with taking ownership of a problem. However...
The problem is that "people that make it happen" frequently aren't the "people that make it happen right". The...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 17, 2011 at 11:13 am
Koen Verbeeck (12/14/2011)
Jeff Moden (12/14/2011)
praneshram (12/14/2011)
----Last Day of Last MonthSELECT DATEADD(ms,-3,DATEADD(mm,0,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0))) 'Last Day of Last Month'
Gosh no. Always find the first day of the next month and use "less...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 17, 2011 at 8:34 am
Basically correct. Just making sure. Remember that it's also aggregating the data as it "pivots" the data.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 16, 2011 at 11:02 pm
Viewing 15 posts - 31,636 through 31,650 (of 59,102 total)