SELECT RowID=(ROW_NUMBER() OVER(ORDER BY(SELECT 0))) FROM dbo.tbl_name
SELECT RowID=IDENTITY(INT,1,1) INTO #tb1 FROM dbo.tbl_name SELECT * FROM #tb1