Viewing 12 posts - 1 through 12 (of 12 total)
I worked on a project we just about every program had a comment in it which read
// Jim QQQ is a moron
Jim QQQ was a'programmer' whose brother owned the...
March 24, 2015 at 2:08 pm
39 shots! First game win. Lost in 38 second game. Great job!
December 30, 2014 at 12:22 pm
Thanks. You are right about using integers for dates. Just got lazy.
December 16, 2014 at 12:17 pm
david.gugg (12/16/2014)
SELECT s.*
FROM dbo.Stocks s
WHERE s.id IN ( SELECT s.id
...
December 16, 2014 at 8:06 am
Oops. Sorry about leaving the dbo in there. That could be the topic of a good QotD. That can be a nasty, hard to find issue.
December 16, 2014 at 7:39 am
Short answer, yes, the WHERE clause could be left out. Thanks for pointing that out.
Long answer: It's usually a bug. The idea is that you are trying to link...
December 16, 2014 at 7:37 am
I was unhappy with the whole question because I was sure I got the math right. Then I read some of the other comments and realized that ^ means something...
December 8, 2014 at 9:02 am
Yes. Looking at the execution plan, it is using the index for both options.
November 13, 2014 at 8:50 am
That's the way I am leaning. After reading a bit, it appears that SQL Server engine will try to optimize the order of the items in the 'IN' clause. This...
November 13, 2014 at 8:45 am
I ran both versions against a DB table with about 1.2 million rows.
Without the get days it took 35 seconds.
With Igor's version it took 39 seconds.
With my version it...
October 31, 2014 at 6:08 am
CREATE FUNCTION dbo.fnGetMonthDays(@myDate DATETIME) RETURNS INT
AS
BEGIN
return DATEDIFF(d, DATEADD(month, DATEDIFF(month, 0, @mydate) , 0) ,DATEADD(d, -1, DATEADD(m, 1, DATEADD(month, DATEDIFF(month, 0, @mydate) , 0)))) + 1
END
go
select...
October 29, 2014 at 6:08 am
Viewing 12 posts - 1 through 12 (of 12 total)