Viewing 15 posts - 2,461 through 2,475 (of 4,080 total)
Truly, you are the man, Flo. 😉
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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)...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
September 1, 2009 at 12:14 pm
Starts tomorrow for me, 2AM precisely.
Presenting or attending, Gail?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
September 1, 2009 at 11:31 am
Whups
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
September 1, 2009 at 11:30 am
Good luck with your 2 a.m. presentation, Gail.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
September 1, 2009 at 9:51 am
Sure hope you're feeling better, Barry. If not now, then soon.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 31, 2009 at 9:00 pm
select * from #test b
where b.id= (select max(id) from #test t
...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
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...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 31, 2009 at 8:33 pm
The trigger will always fire, and will only fire, when an INSERT takes place. You will have to put logic within the trigger to test for the other conditions,...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 31, 2009 at 3:00 pm
Viewing 15 posts - 2,461 through 2,475 (of 4,080 total)