Viewing 15 posts - 1 through 15 (of 20 total)
On the men/women thing, do the file names contain a substring that identifies the gender contained within the file? And if so, is that substring consistent over time, so that...
November 8, 2011 at 10:56 am
Ok, to be clear, let's address the For Loop issue first.
I think you want a For Each Loop Container, not a For Loop Container. A For Loop is best for...
November 8, 2011 at 10:54 am
I'm a little fuzzy on your needs, but I think you may be looking to use a For Each Loop Container. An FELC is a task container that allows you...
November 8, 2011 at 10:01 am
I have a new favorite method, courtesy of Mike Powell at
http://stackoverflow.com/questions/58429/sql-set-based-range
No dependencies, backward compatible w/ 2005.
DECLARE @MyDates TABLE(d DATETIME NOT NULL);
WITH CTE AS (
SELECT1 AS n
UNION ALL
SELECTn + 1 AS...
November 8, 2011 at 7:50 am
Thanks, ColdCoffee. I owe drew.allen for expanding my thinking on using APPLY.
And good points about the assumptions. I guess a false assumption on either of those two points could complicate...
November 7, 2011 at 9:43 pm
How's this:
SELECTB.[To] AS IdleFrom
, A.[From] AS IdleTo
FROM A
OUTER APPLY(
SELECTTOP 1 [To]
FROM
WHERE[To] < A.[From]
ORDER BY[To] DESC) B
WHEREB.[To] IS NOT NULL;
November 7, 2011 at 9:10 pm
Sanz,
You might do a little better by providing more details in your post. Many of the gurus on this site (I'm absolutely not one of them) will not bother to...
October 27, 2011 at 11:04 am
Based on current indexing, execution time on all three is very close. The two suggestions show a higher cost, but I can see where some index tuning may make them...
October 27, 2011 at 9:31 am
If ROW_NUMBER is used instead of RANK, won't it produce unpredictable results in cases when there are ties? In R.P.'s data sample, rows 2 through 7 are interpreted by ROW_NUMBER...
October 27, 2011 at 9:18 am
Thanks, Drew. So you're suggesting something like this?
WITH Rnk AS (SELECT Key, Date, Status
, RANK() OVER(PARTITION BY Key ORDER BY Date DESC) AS Ranking
FROM table
)
SELECT Key, Date, Status, Ranking
FROM Rnk
WHERE...
October 27, 2011 at 7:41 am
I'm not exactly clear on what you're after, but take a look at the code below. I make no claims about it's performance, other than to strongly suggest that you...
October 27, 2011 at 1:20 am
Viewing 15 posts - 1 through 15 (of 20 total)