Reputation: 3591
SELECT object_id('dbo.groups','U'); //NULL
Upvotes: 2
Views: 3218
Reputation: 4007
OBJECT_ID returns NULL on error.
A user can only view the metadata of securables that the user owns or on which the user has been granted permission. This means that metadata-emitting, built-in functions such as OBJECT_ID may return NULL if the user does not have any permission on the object.
For more information, see Metadata Visibility Configuration.
Upvotes: 6