Subject RE: [ib-support] Enterprise Use
Author Leyne, Sean
Nige,

> However:
> create table tbl_sitebuildings (
> int_siteid INT64 NOT NULL,
> int_building INT64 NOT NULL,
> str_name VARCHAR(100) NOT NULL,
> PRIMARY KEY(int_siteid, int_building)
> );
> Allows a generator to supply int_building values, which start
> from 1, inc by
> 1, and can collide as much as they like. Adding in sites
> involves using a
> default siteid for the new site's data.

This approach will work but I'd like to suggest another solution.

I would recommend that you use a GUID/UID value as the key. GUID/UIDs
are 128 bit values which are designed/guaranteed to be unique (well
their a very very very small chance of duplicates -- 1 in something like
2 trillion).

Another big benefit is that the value can be calculated/generated by the
client computer, which removes a DB call to get the generator value.


Sean