How can we help you today? How can we help you today?

"Value was either too large or too small for an Int64" error

Hi,

I'm getting the subj error on extremum values for decimal(28,0) primary keys. Any help would be appreciated - I really needed this working about an hour ago :)

SQL Compare v.3.2.0.5

Thanks,

Alex.
aboyko
0

Comments

2 comments

  • aboyko
    Just realized that my previous post is incomplete:

    Here is an example of what SQL Compare refuses to believe:

    CREATE TABLE TableDecIdentity1 (
    identity_col decimal(28, 0) IDENTITY (-9999999999999999999999999000, 1) NOT NULL
    )

    Thanks again,

    Alex.
    aboyko
    0
  • Brian Donahue
    Hello Alex,

    I don't think that there is anything that we can do to help short of very extensive modifications to the software. The precision and scale for an identity field need to fit into a 64-bit space, because the largest numeric datatype in the .NET Framework is an Int64. That gives 18446744073709551616 possible values which is too few for the number that you've set. This isn't a problem for SQL Server, apparently, because it does a clever trick of storing the number as a series of bytes, apparently.
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.