We use two different development methods :
1.
Classical, where we want to use identity as present in SQL-server.
2.
Java, where they do everything their own way, including identity.
The have a special table to fetch 20 numbers at a time and
use that as identity in another table.
Now both methods have to be combined. One of the ideas was
odd and even numbers. One method used odd numbers the other uses
the even numbers. When inserting with Java switch identity
insert on, do the insert, switch the identity insert of.
I do not like this 'solution', but I would like some SOLID arguments
against it.
Arguments against this method ?
Solutions to this problem ?
thanks in advance,
(If a similar question appears on the list,
I did send this question before, but I do not see it.
probably clicked it away.).
ben brugmanben,
If I am generating IDs outside of SQL for some reason, I would incline to
creating code inside SQL to generate the IDs algorithmically. However, it
is not impossible, just messy.
(You might want to read up on Identities and Replication in the BOL for some
thoughts.)
You would need to be careful in running DBCC CHECKIDENT (if you ever do) not
to mess up your interleaving.
If you decide to do even/odd, then Seed the identity with an even number and
an increment of 2. Should reseeding ever become a problem you will need to
get the highest identity and specifically reseed to the next even number.
A safer method would be to seed the SQL Server identities high (e.g.
1,000,000,000) and let Java play in the lower range. That way, should you
ever need to reseed because of some problem there is less to fool with.
(And the guy who comes after you is less likely to make a mistake.)
FWIW
Russell Fields
"ben brugman" <ben@.niethier.nl> wrote in message
news:%23CknUgegDHA.2084@.TK2MSFTNGP10.phx.gbl...
> We use two different development methods :
> 1.
> Classical, where we want to use identity as present in SQL-server.
> 2.
> Java, where they do everything their own way, including identity.
> The have a special table to fetch 20 numbers at a time and
> use that as identity in another table.
> Now both methods have to be combined. One of the ideas was
> odd and even numbers. One method used odd numbers the other uses
> the even numbers. When inserting with Java switch identity
> insert on, do the insert, switch the identity insert of.
> I do not like this 'solution', but I would like some SOLID arguments
> against it.
> Arguments against this method ?
> Solutions to this problem ?
> thanks in advance,
> (If a similar question appears on the list,
> I did send this question before, but I do not see it.
> probably clicked it away.).
> ben brugman
>
No comments:
Post a Comment