Increasing int column in MS SQL Server table via SP
Is there a T-SQL statement to automatically populate an empty column in a table with incremental values โโstarting at one specific value?
eg.
UPDATE A SET A.NO = ROW_NUMBER() OVER (ORDER BY A.NO) + @max WHERE A.NO is NULL
This statement doesn't work and I don't know how to run it ...
Any help is appreciated!
+2
source to share
2 answers