4 ms·
It could be problematic to have an identity column with a 0 value because you could pass in a value that evaluates to 0 (e.g. an empty string or single space).
by byoung2 13y ago
It could be problematic to have an identity column with a 0 value because you could pass in a value that evaluates to 0 (e.g. an empty string or single space). An error in your code or some other condition that doesn't pass a proper id, but that evaluates to 0, would wipe out the first entry in the table.
Identity columns are more closely tied with the data in the row than array indices are, so wiping out array index 0 is not as bad as wiping out a database row with id 0.
EDIT: Here's an example: http://sqlfiddle.com/#!2/dd3ed/6 http://sqlfiddle.com/#!2/dd3ed/6