equivalent of oracle sql administration query in SQL Server 2008 I'm new to SQL Server administration, and I would like to get the equivalent of this Oracle 9i administration query : 

select object_type,count(*) as number
from all_objects 
where owner='ownerSID'
group by object_type;


Any help would be greatly appreciated :)
As in Oracle the owner column denotes the schema, the following should be roughly equivalent:

select type_desc, count(*) as number
from sys.all_objects
where object_name(schema_id) = 'ownerSID'
group by type_desc;


Not sure how to get the real "owner" in SQL Server though  (the user who owns the object is not the same thing as the schema).

In SQL Server foreign keys, primary keys and other constraints are also contained in that view, so you probably might want to exclude them with a where type not in ('F', 'D', 'PK')