I have a table Person.
Id, Name, Phone
-------------------
1, NULL, 123456789
This Person.Id is an auto increment identity. After a while, I found Name
is useless for the current business and it always is NULL. So I deleted this column.
Later, I found one person can have multiple phone numbers. And since SQL Server doesn't support array type, I had to move this Phone to a separated table. So, there is just one column Id left.
Is a one column table good design?
I have enough reason keep this one-column table, because the Id is important for other tables (link).
But there is a problem for the INSERT query.
INSERT INTO Person(Id) OUTPUT Inserted.Id VALUES(DEFAULT)
The value either DEFAULT
or NULL
wouldn't work with the error message:
DEFAULT or NULL are not allowed as explicit identity values.
Leave the parentheses empty also doesn't work.