How to retrieve all database objects with the help of query?
i had problem to retrieveing all database objects from sql server2008 so plz help me to how to write query to retrieve it??
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jan 21, 2013, 8:27 PM EST
select * from sys.objects
you can find types of object in the below list
Type Type description
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 21, 2013, 10:24 PM EST
I agree with Santhosh, you can get all object info from sys.objects table but it hasn't any information about index object. you may find it from sys.indexes table.
select * from sys.objects
select * from sys.indexes
select name,object_id,type,type_desc from sys.objects
union
select name,object_id,cast(type as varchar),type_desc from sys.indexes
hope this will help you.