;with cte as ( SELECT FirstName, ROW_NUMBER() OVER (ORDER BY ID) RN FROM YourTable ) UPDATE cte SET FirstName = 'Demo_ ' + CAST(RN AS VARCHAR(10))
Or do you want you to use the ID field directly?
UPDATE YourTable SET FirstName = 'Demo_ ' + CAST(ID AS VARCHAR(10))
NB: You say that you have thousands of records, but obviously they will not fit into the Demo_01 format. Suppose you want to allow up to 6 digits and fill with leading zeros, you can use something like.
UPDATE YourTable SET FirstName = 'Demo_ ' + RIGHT('000000' + CAST(ID AS VARCHAR(6)),6)
source share