dwain.c (10/3/2012)
Jason-299789 (10/3/2012)
I think its the fact that the Row_number() requires an order by statement thus a sort, rather than an Identity which assigns the number as the data is returned.OK. So I would have been 3.5 out of 4. What I don't get is the ISNULL around ROW_NUMBER().:unsure:
Because if you do: -
SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS N
INTO yourTallyTable
FROM (VALUES(1))a(n);
Then N is a NULLable column. You want it to be NOT NULL, so include the ISNULL(ROW_NUMBER() OVER(ORDER BY (SELECT NULL)),0)
I think there might be a connect item about it somewhere. . . but can't seem to find it.