November 25, 2005 at 6:36 am
Hey
Does any one knows how this T-SQL works ?
WITH ONE_MIL_t AS
(SELECT * , ROW_NUMBER() OVER (order by abc, startdate)as RowNumber
FROM ONE_MIL )
SELECT *
FROM ONE_MIL_t
where RowNumber between 20 and 100000 ;
Does SQL Server creates temp table or a virual table in the memory dynamically.
Can i get resulset like rows + row_number between 100 - 200 using cursors. Will cursor give same performance like above or ???
Regards
Shrikant Kulkarni
November 28, 2005 at 8:00 am
This was removed by the editor as SPAM
November 29, 2005 at 1:17 am
Yes, I did some r&d on the same. its Common Table Expression (CTE) a new feature in Yukon. As far as documentations says this gives better results than Select .. into <t_table_name>. from <table_name>, also CTE has other advantages too. More info on CTE
http://www.databasejournal.com/features/mssql/article.php/3502676
As far as cursors are concerned, i think we can't implement same logic in this case. If any one have it will be great !!
Regards
Shrikant Kulkarni
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply