View Single Post

   
  #4 (permalink)  
Old 03-06-2008, 03:04 PM
David Portas
 
Posts: n/a
Default Re: Can we rely on object_id always increasing?

On 4 Mar, 19:10, rajigo...@gmail.com wrote:
> Hi,
>
> When we create new user objects, can we assume that the object_id will
> constantly increase? In other words, if I create a table and then a
> view, is it true that the object_id of the view if I query sysobjects
> view will be greater than the object_id of the table?
>
> Thanks!


Why would you want to assume that though? Even if it were true that
object_id matched creation order it's still a dangerous assumption.
Some people use the Management Studio UI to make modifications to
objects and Management Studio will sometimes drop and recreate objects
and sometimes not.

I don't condone the use of Management Studio in this way but it does
explain why the object_id might increment unexpectedly - or perhaps
fail to increment when you expect it to.

--
David Portas
Reply With Quote