Based on following TableA
Data
--------
Dummy1
Dummy2
Dummy3
.
.
DummyN
is there a way to generate sequence number while selecting rows from the table.
something like select sequence() as ID,* from Data that will give
ID Data
---------
1 Dummy1
2 Dummy2
3 Dummy3
....
N DummyN
Thanks.
Do you want to have a column in your table that is a sequence? Use
INT IDENTITY.Do you want to add a sequential number to a SELECT statement or a view?? Use the
ROW_NUMBER() OVER(ORDER BY .....)method.