Is it safe to use OBJECT_ID() as a reference in your own tables, with the assumption that the value will always refer to the same database object no matter what?
The msdn states
All metadata functions are nondeterministic. This means these functions do not always return the same results every time they are called, even with the same set of input values.
so that would indicate it’s not safe, but I couldn’t find any (other) hard facts that it shouldn’t be done, and, to be fair, no examples of people actually doing it, which in itself might be evidence not to do it.
But the value OBJECT_ID() is (or seems to be) used in the system tables and views as keys from one object to another, so there must be some form of integrity and reliability.
For the record: I don’t necessarily need it, but it just popped into my mind as an option while designing my system, and got curious.