Viewing 15 posts - 2,461 through 2,475 (of 4,081 total)
Hardly. I just get a lot of mileage out of stolen techniques and some lucky guesses. 😛
September 1, 2009 at 2:58 pm
Truly, you are the man, Flo. 😉
September 1, 2009 at 2:49 pm
HAH! I was right!! (cruel chuckle)
The DENSE_RANK solution adds a sort and segment to the execution plan, so the DATEDIFF solution runs twice as fast...
September 1, 2009 at 1:52 pm
Isn't DENSE_RANK going to force a sort?
declare @startDate datetime
set @startDate = '11/1/2009'
select DATEDIFF(month,0,@startdate)-1317 -- this datediff calculation is the solution
-- proof
;with tally (N) as (select row_number() over(order by id)...
September 1, 2009 at 1:18 pm
PARTITION BY means to start counting all over again from 1 when this value changes. It isn't required.
Try this:
,row_number() over (ORDER BY day_date)
But, if you have one...
September 1, 2009 at 12:48 pm
AND property.number 500
First off, you shouldn't be getting ANY rows back based on that criteria. Yet another reason we ask to see actual code.
You can rewrite it...
September 1, 2009 at 12:33 pm
Here is an example that just logs the first names instead of emailing them, but you should get the idea.
You didn't mention whether or not you might...
September 1, 2009 at 12:14 pm
Starts tomorrow for me, 2AM precisely.
Presenting or attending, Gail?
September 1, 2009 at 11:31 am
Good luck with your 2 a.m. presentation, Gail.
September 1, 2009 at 10:18 am
Kruti:
CONVERT is unecessary if the target is large enough, and won't help if it isn't.
-- this will fail
declare @source int
declare @target numeric (6,2)
set @source = 35677
set @target = CONVERT(numeric(10,2),@source)
select 'Example...
September 1, 2009 at 9:59 am
When you get to 2008, you will also be able to pass table variables as input parameters. However, we have a lot of code that parses strings...
September 1, 2009 at 9:51 am
Sure hope you're feeling better, Barry. If not now, then soon.
August 31, 2009 at 9:00 pm
select * from #test b
where b.id= (select max(id) from #test t
...
August 31, 2009 at 8:40 pm
For starters, I'd like to know which steps are taking the most time. If you are doing a table scan of a zillion large rows, that could...
August 31, 2009 at 8:33 pm
Viewing 15 posts - 2,461 through 2,475 (of 4,081 total)