How Row Number () works in yukon

  • 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

  • This was removed by the editor as SPAM

  • 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