Viewing 15 posts - 841 through 855 (of 1,473 total)
jeanangeo (12/27/2008)
December 27, 2008 at 10:07 am
After some tests, ROW_NUMBER is still slow. I ran both queries on a real table and came up with 76% of the cost vs 24% of the cost when...
December 26, 2008 at 1:49 pm
MrBaseball34 (12/26/2008)
Anything else Mr. Holmes?
I really don't see any reason to be rude to someone who is attempting to help you, even if their suggestions in this particular case don't...
December 26, 2008 at 12:09 pm
Jack Corbett (12/26/2008)
Garadin (12/26/2008)
With the way that derived table is written, if you have more than 1 appointment that has the MAX(date), you will get multiple returns.
Seth,
The way I...
December 26, 2008 at 12:06 pm
Just to tie up the loose ends, this solution should be correct, and handle all situations.
;WITH MA( Apprentice_id, Agreement_ID, [Start_Date], RN )
AS
(SELECTApprentice_ID,
Agreement_ID,
[Start_Date],
ROW_NUMBER() OVER (PARTITION BY Apprentice_ID ORDER BY [Start_Date] DESC)...
December 26, 2008 at 10:16 am
Not a problem, Jude, glad we could help.
I did figure out the issue with mine though, which is only an issue with multiple appointmentID's being the same. So, the...
December 26, 2008 at 10:05 am
A few things
1. To turn on actual execution plan, go to the Query option in the menu and select 'Include actual execution plan.'
Alternatively, hit CTRL + M.
2....
December 26, 2008 at 9:59 am
Q-Girl (12/26/2008)
December 26, 2008 at 9:08 am
:hehe: Mornin Jack :hehe:
I had an almost identical post typed out, then decided to try to get used to the new 2005 stuff that I always ignore. ...
December 26, 2008 at 8:53 am
To know how to handle it, we need to know what agreement_id you want.
Do you want the start date of each? Add it to the group by.
Do you...
December 26, 2008 at 8:28 am
In a situation like this, I'd make a table like this instead:
Table:CodeGroups
CodeID
GroupID
IsExcluded
Store a groupID for every codeID. Then, you can write your queries just by linking through this table....
December 26, 2008 at 6:49 am
I've never liked using JOIN's in delete statements, but I think you'd have to do it like this:
CREATE TRIGGER [t_ptSchedule_TO_ptAppointmentsDELETE]
ON [dbo].[ptSchedule]
AFTER...
December 24, 2008 at 10:06 am
Greg Snidow (12/24/2008)
December 24, 2008 at 9:43 am
MrBaseball34 (12/24/2008)
I didn't see where you deleted the old ptAppoinment record(s)
To expand upon this (Jack is right that you don't need to delete).
What you were doing in your last trigger...
December 24, 2008 at 9:40 am
Yeah, I probably overuse left joins in situations like that. But he does allow NULL's (I still have a copy of that tabe definition from a past problem) in...
December 24, 2008 at 9:35 am
Viewing 15 posts - 841 through 855 (of 1,473 total)