Viewing 15 posts - 8,146 through 8,160 (of 10,144 total)
Alvin Ramard (2/5/2010)
The Thread: Just what do you think you're doing, Steve?
The Thread: Look Steve, I can...
February 8, 2010 at 2:11 am
djbuzz (2/5/2010)
This query does not work in my SQL 2008 Server:
SELECT dbo.ip2Tags.ip, dbo.ip2Tags.MediaId
FROM dbo.ip2Tags LEFT OUTER JOIN
...
February 5, 2010 at 7:15 am
Paul White (2/3/2010)
Mark-101232 (2/3/2010)
Might be of interesthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=318084
Hi Paul
This has turned out to be a real can of worms. I couldn't see anything wrong using the example code and data...
February 5, 2010 at 5:43 am
Andeavour (2/4/2010)
February 5, 2010 at 2:04 am
sgmunson (2/4/2010)
row_number() does not get properly evaluated - it's as if it gets a fresh evaluation from scratch for each row in the iteration
But what if it's correctly "evaluating" only...
February 4, 2010 at 7:23 am
Paul White (2/3/2010)
Mark-101232 (2/3/2010)
Might be of interesthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=318084
Thanks for posting this, Paul, it's made for a very interesting lunchtime.
If you add a third anchor row, like this...
with T(i, rn, lvl)...
February 4, 2010 at 7:17 am
The lvl value should be 3 where the parentid value is 3. The windowing function worked fine, but the lvl increment in the recursive part of the CTE didn't.
February 3, 2010 at 10:24 am
Mark-101232 (2/3/2010)
Might be of interesthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=318084
Thanks for this, Mark. Interesting note - the example query actually does run in compatibility 100 mode.
Edit: On second thoughts, that's quite scary, expecially considering the...
February 3, 2010 at 8:56 am
Might have a play with this at home tonight, it looks promising. This method works as a single-query solution but it looks horrible.
Cheers
ChrisM
February 3, 2010 at 8:09 am
Hi Steve
As promised.
Here's the multistatement code:
-- create table for results
CREATE TABLE #Iteration (PreferenceId INT, BoxId INT, BallId INT)
-- four iterations to solve:
INSERT INTO #Iteration
SELECT PreferenceId, BoxId, BallId
FROM ( -- x
SELECT...
February 3, 2010 at 2:28 am
<<limit the recursive selection to rows that aren't already in our selection>>
Hi Steve
I'm not sure a recursive CTE will easily lend itself to this, because what your recursive query 'sees'...
February 2, 2010 at 10:05 am
Matt Miller (#4) (2/1/2010)
February 2, 2010 at 7:03 am
Nabha (1/27/2010)
Not sure if I am missing something here but isnt it the same query that was posted earlier hereI guess discussion was already started there!
Guess the OP didn't like...
January 27, 2010 at 8:11 am
Jpotucek (1/27/2010)
so how do I get my query to actually populate History_YN with either blank, Y or N?
Take it out of the WHERE clause. You must have had it in...
January 27, 2010 at 7:59 am
klineandking (1/27/2010)
January 27, 2010 at 7:48 am
Viewing 15 posts - 8,146 through 8,160 (of 10,144 total)