i'm using this query on SQLServer 2017:
DECLARE @id int
SET @id = 0
UPDATE aicidich00fuff
SET @id = trasco_id = @id + 1
but for some reason it doesn't create an unique value. It is easily notable if I run the following:
select COUNT(*) cont, trasco_id from aicidich00fuff group by trasco_id order by trasco_id
cont trasco_id
4 1
4 2
4 3
4 4
4 5
4 6
4 7
4 8
4 9
and so on. Fun fact is that most values are repeated four times, then three times, then twice. This query for autoincrementing a column has worked since a few weeks ago, but now every time i got this behaviour. Any tips? Thanks