Viewing 15 posts - 33,301 through 33,315 (of 59,099 total)
Actually, taking BitBucket's lead, the following is quite quick... provided you want (and you should want) a real DATETIME datatype.
SELECT CAST(REPLACE(SomeVarcharDateColumn,' EDT','') AS DATETIME)
FROM dbo.MillionRowTable
The real...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 11:30 pm
{Note to self... add more questions about DRI to the interview questions I ask}
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 10:36 pm
kiran41 (7/14/2011)
I need to write the Exam 70-450.
Kindly send me the study material\dumps for Exam 70-450[PRO: Designing, Optimizing and Maintaining a Database Administrative Solution Using Microsoft SQL...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 10:19 pm
Mark Tierney (7/14/2011)
I have a recursive CTE I am using to determine a hierarchy path. I have used these queries before but am a little foggy on the default...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 10:06 pm
Craig Farrell (7/14/2011)
Since sargability and index seeking are pretty much out the window, this should work for your join:REVERSE( RIGHT( REVERSE( AddressCode), 9)) = ID
EDIT: Misplaced a parentheses.
I have to...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 9:57 pm
That should run quite a bit faster.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 1:31 pm
It's not going to matter... even though I'm seriously disappointed in the performance (as you've measured), the new SUM() is faster than a While Loop, easier to write, does not...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2011 at 11:37 am
It's a "dumb" little test to (supposedly) separate people who know how to code from the ones that don't. A whole lot of time has been wasted on it,...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 13, 2011 at 5:19 pm
Freddie-304292 (7/13/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 13, 2011 at 2:47 pm
ejoell 66477 (7/13/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 13, 2011 at 2:20 pm
The need to double-up on % for the variable is to escape the % because there are other variables that use % as a lead character in batch code.
Clever use...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 12, 2011 at 7:49 am
opc.three (7/10/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
July 11, 2011 at 8:48 am
tfifield (7/8/2011)
Jeff Moden (7/8/2011)
Nevyn (7/8/2011)
Cool stuff, Jeff!So do you ever use PIVOT and/or UNPIVOT, or are workarounds almost always better/faster?
I don't use PIVOT because Cross-Tabs are (usually) both faster and...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 9, 2011 at 11:35 pm
opc.three (7/9/2011)
The entire set of code with The Dixie Flatline solution modified to work with the concrete test tables:
I have to ask... is there a reason why you avoid the...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 9, 2011 at 10:56 pm
I've found the problem. Precision is lost during the multiplication. SQL Server multiplies differently than Excel does. Excel can handle up to 30 decimal places. When...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 9, 2011 at 9:53 pm
Viewing 15 posts - 33,301 through 33,315 (of 59,099 total)