I noticed strange behavior in SQL Server Express 2008, and I was trying to identify the cause. When you create a new database, you can access the sys.sysobjects view without specifying a schema identifier as follows:
SELECT * FROM [sysobjects]
You can do this even if your default schema is something other than sys. My understanding of schemas is that the database engine will first search for an object in the user's default schema, and then look for the dbo schema if the user has permission, and then stop looking. In addition, I know that the sys.sysobjects view can be accessed, because by default a permission is granted for the public role to choose from. I just don't know why it can be accessed without a schema name.
Does the engine continue to search for an object after checking the "dbo" schema, is sysobjects a special case scan, or is it something else completely?
Shaun source share