Instead of:
Select field1, field2, ..., fieldN
>From MyTable
Where blah blah
You could have within a Stored Procedure:
Create table #TempTable (MyAutoNumber int not null identity (1,1),
Field1 varchar(255), Field2 int, ..., FieldN datetime)
Insert into #TempTable (Field1, Field2, ..., FieldN)
Select field1, field2, ..., fieldN
>From MyTable
Where blah blah
Select * from #TempTable order by MyAutoNumber
-----Original Message-----
From: Thanh Nguyen [mailto:[EMAIL PROTECTED]
Sent: Monday, August 30, 2004 14:49
To: SQL
Subject: auto-numbering the rows that the SELECT statement retrieves?
Can I create a simple SELECT statement that generates an IDENTITY-type
value by auto-numbering the rows that the SELECT statement retrieves?
Thanh Nguyen
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
