Posted by helmut woess on 09/18/05 18:51
Am 18 Sep 2005 07:57:39 -0700 schrieb --CELKO--:
>>> But if i check the IDENT_CURRENT from a newly created table the result should be NULL, or not? <<
>
> What would a NULL value mean? Why not zero? Remember IDENTITY is
> proprietary and non-relational, so it can do anything it wants.
>
> Think about how it would work if you had a 1950's sequential tape file
> system. The counter starts at one and is incremented after the
> insertion instead of before. It is the position of the read/write head
> of the maganeitc tape drive.
We have NULL to mark something as unknown. Why not using it?
In the manual IDENT_CURRENT is described as "gives back the last generated
ident value". So from my logical point of view it cannot give back a value
if it has not generated a value before. And because zero can be a valid
starting value it can't give back zero.
Maybe it would be better we have a IDENT_NEXT which shows the next value
which will be used, instead of IDENT_CURRENT. This could avoid such
misconception.
bye,
Helmut
[Back to original message]
|