• I tried your example with sql 2005 but it gives me this error

    Msg 195, Level 15, State 10, Line 1

    'ROWNUMBER' is not a recognized built-in function name.