0
I have the table empresas
as an example:
cod | nome
----|----------
3 | Asterix
7 | Lunar
13 | Coimbra
Fortunately the table of companies currently has no reference in another table, I would like to be able to put the numbers of the primary keys (column cod
) in sequence leaving the table as below:
cod | nome
----|----------
1 | Asterix
2 | Lunar
3 | Coimbra
Then I’d have to make one update in all records, I know that if I start from the registry with the lowest value key and continue up to the highest value key I will not have key breach problem, I wonder if this is possible.
Initially I will do this in a database Firebird, but if someone posts an answer on postgresql or sql-server will have my vote.
After all it is postgresql, Firebird or MSSQL?
– Sorack
If you post any of these will have my vote, the preference today is Firebird.
– Laércio Lopes