sql server - Composite Primary key vs. Auto-Increment Primary key -


i looking little advice on how proceed table have been importing case data department:

  id    creationdate                closeddate  lastupdatedate            name                                 description           de5838  2015-06-02 06:14:11.11      null        2015-06-02 06:19:33.33    : should updated ...      description : not defect…           de5834  2015-06-01 16:16:03.03      null        2015-06-01 16:24:19.19    sync error ultimate packages...  getting error ....          de5822  2015-06-01 10:37:10.10      null        2015-06-01 10:37:10.10    terminal subscription has expired... given terminal serial number…             de5818  2015-06-01 09:53:44.44      null        2015-06-01 09:53:44.44    no option code…                      allie pulled report....           

for quite time, (and without of data definition outside department), have been treating id field pk - starting see other department has been recycling these id numbers (i know, know - really bad idea).
so, leaves data trying import - our table not accept unique identifier assigned case data.

thinking might solution change pk composite id , creationdate (which believe may be way outside department creating data), or add auto-incremented id field , assign unique identifier of data have.

but inherited mess walked into, looking advice in how proceed this.

creating composite key not make alter index, tables reference primary key have have additional column added. recommend adding identity field on table. rename current id field referencenumber. update foreign references in other tables use new id. convert foreign key fields integer fields. save space in database , result in faster joins in future.

then have make sure interfaces updated lookups referencenumber / dateor new id.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -