In this article we will see how to get the Database objects Information using a query.
What are database objects?
- Views
- Tables
- Stored Procedure etc.
Helpful information available:
- Object
- Type
- Type_desc
- Schema_id and also we have more info in that table.
Step 1: Gets the complete information of database Views under the used Database:
use AdventureWorks
select * from sys.views
Step 2: Output of Sys.views:
Step 3: Gets the complete information of database Tables under the used Database:
use AdventureWorks
select * from sys.tables
Step 4: Output of Sys.tables:
Step 5: Gets the complete information of database Procedures under the used Database:
use AdventureWorks
select * from sys.procedures
Step 6: Output of Sys. procedures:
Step 7: Gets the complete information of database Objects under the used Database:
use AdventureWorks
select * from sys.objects
Step 8: Output of Sys.objects:
Thanks for reading this article. Have a nice day.