I have upgraded a database at work from a poorly designed Microsoft Access database to a SQL database.
The previous system allowed NULL
values and duplicates to be inserted into a field that should not allow NULL
values or duplicates. Since the existing data already has some entries that are NULL
, I cannot set NOT NULL
constraints.
My solution would be to use a sequential operator. For instance, NULL
data would be changed to a sequential number that system administrators would know was a bogus number starting at something like 999999900, incrementing up from there. There are only 250 records that would require updating.
To make things more interesting this field is not a integer type, its a VARCHAR
type as it is a Hardware ID. The existing data contains both alpha and numeric data.
Any advice on how to update these NULL
values using an incremental ID?