Book a Demo

Author Topic: Unable to use negative StartNum for AutoIncrement  (Read 4139 times)

Necrowizard

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Unable to use negative StartNum for AutoIncrement
« on: November 20, 2010, 01:04:52 am »
This StartNum:

http://www.sparxsystems.com/uml_tool_guide/data_modeling/createcolumns.htm

Well, in my database MSSQL Database I use INTs as Identifier. The range of an INT is -2^31 to 2^31. I know its not very common to use a negative Identifier, because that seems to look weird, but that's kind of stupid in my opinion.

Basically if you have to start at 0, you are throwing away half your range...

And no, MSSQL does not have unsigned INTs.

Enterprise architect does not allow you to input negative values into the StartNum field, which I think is an issue. Actually, I think it should be INT(MIN), or {VALUETYPE}(MIN) by default, instead of 0, to not encourage people to throw away half their range...

Steven

  • Guest
Re: Unable to use negative StartNum for AutoIncrem
« Reply #1 on: November 22, 2010, 07:22:43 pm »
Is this really about ranges or something else?
Because I have no idea why you could even think this is an issue.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Unable to use negative StartNum for AutoIncrem
« Reply #2 on: November 23, 2010, 08:32:24 am »
Edit: Nevermind, my response was apparently written without reading the original question.  I've done that now... :(
« Last Edit: November 23, 2010, 05:16:56 pm by simonm »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Unable to use negative StartNum for AutoIncrem
« Reply #3 on: November 23, 2010, 11:45:19 am »
Quote
Is this really about ranges or something else?
Because I have no idea why you could even think this is an issue.
Hi Steven and Simon,

it is about ranges - but not as we know them...

In the past I have very successfully used negative surrogate keys for specific purposes.  In particular, I use a series of negative extrinsic keys (which fortunately aren't subject to the sequence problem and so I can "get away with it" even in EA) to get around Codd's "12 types of Null problem".

However, one can gainfully use negative surrogate keys with the negative bit acting as a kind of flag.

So I support lifting the restriction.

Just to repeat, it's NOT about the absolute range, but the ability to use negation as a flag.

Paolo
« Last Edit: November 23, 2010, 11:45:51 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!