Here is an example of how you can do this:CREATE TABLE #Assets(Asset_ID VARCHAR(255));INSERT INTO #Assets VALUES ('manhole'),('manhole'),('manhole'),('valve1'), ('valve2'),('pipe'),('pipe');;WITH cte AS( SELECT *, ROW_NUMBER() OVER (PARTITION BY Asset_id ORDER BY (SELECT NULL)) AS RN, COUNT(*) OVER (PARTITION BY Asset_id) AS DupCount FROM #Assets)--SELECT * FROM cte;UPDATE cte SET Asset_ID = Asset_ID + RIGHT('0000'+CAST(RN AS VARCHAR(32)),4)WHERE DupCount > 1;SELECT * FROM #AssetsDROP TABLE #AssetsSome useful information is on this link: http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-serverYou would need to take care to make sure that there is not already a row with Asset_ID = manhole1 in addition to all the other manholes.