Replace identical values in same column with unique identifier

I have a worksheet where lots of cases have the same value in that column (B) that is actually supposed to serve as a primary key when importing this file into a database, i.e. no value in this column/variable must be the same as any other, so that value can serve to identify the case. Here’s a screenshot:

How can I automatically replace all values in this column with numbers 1-207?


fill Column B with Formula: =ROW()
fülle Spalte B mit der Formel =ZEILE()


Is it possible to fill each cell of the whole column with the same content in one step, or define a function to be valid for the whoel column, or would I just have to do this 207 times over?
Also If I use this method, won’t the cell numbers change if I rearrange the lines? The value in the cell shouldn’t be affected by changing the position of the line.