由於sql server沒有像oracle有rownum的函數可用,所以必須要使用identity這個屬性....select id = identity(int,1,1),Field1,Field2 into #TABLE FROM TABLE然後再SELECT * FROM #TABLE