It requires an order by, where you can specify any columns, for example:
select *, row_number() over(order by MyColumn1) as num
from MyTable
If the order is not important, then, for example:
select *, row_number() over(order by @@version) as num
from MyTable
To assign numbers in random order:
select *, row_number() over(order by newid()) as num
from MyTable