Select into sql. order) AS row_num FROM [SomeTable] t Tip: It's 2010.