PKID = ZERO - problems?
Posted: Fri Feb 08, 2008 8:55 pm
I occasionally use PKID: 0 inside tables to indicate a system record, one not to be displayed or tampered with by anyone.
Problem is, most tables are auto-incrementing so programatically when I set the PKID as ZERO when creating the record, it always increments anyways. I have to UPDATE the table to a PKID of zero...
Other than this, are there any side effects of reserving the PKID: ZERO for internal system use, in any RDBMS???
In case your wondering, it's just easier to use PKID ZERO than introduce yet another field into the mix to indicate system use only. Although I do use bit fields I prefer this ZERO PKID approach for truely system specific data.
Opinions or experiences???
Problem is, most tables are auto-incrementing so programatically when I set the PKID as ZERO when creating the record, it always increments anyways. I have to UPDATE the table to a PKID of zero...
Other than this, are there any side effects of reserving the PKID: ZERO for internal system use, in any RDBMS???
In case your wondering, it's just easier to use PKID ZERO than introduce yet another field into the mix to indicate system use only. Although I do use bit fields I prefer this ZERO PKID approach for truely system specific data.
Opinions or experiences???