virgilrucsandescu (7/13/2010)
Weird that it works fine for the other tables in Development DB .. It must be something undocumented ...
Possibly the object id returned by OBJECT_ID happens to match a table with an identity column in the context database - you could easily run a query to verify that.
As far as the requirement is concerned, try checking Development.sys.identity_columns instead.
BTW OBJECT_ID does have a second parameter - the object type. As a good practice, I encourage people to specify it. If you are looking for a user table, the second parameter would be 'U'. The types are listed in Books Online under the entry for sys.objects.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi