>DECLARE @Test TABLE (your field list here from original table, RowNumber int IDENTITY(1,1)) > >INSERT INTO @Test (fiel list here w/o ROWNUMBER one) >SELECT ..... > FROM rbpo.rb_Tabs t1 >WHERE ParentTabId = 47 > >SELECT * FROM @Test >It may be a better solution than temp table. I was lazy typing it.