How to Count total number of objects in SQL Server instance

Below query will help you find the list of object counts in the database:

total_count = COUNT(*),
last_crdate = MAX(crdate),
last_refdate = MAX(refdate)
type = CASE
WHEN xtype = ‘U’ THEN ‘table’
WHEN xtype = ‘V’ THEN ‘view’
WHEN xtype = ‘P’ THEN ‘proc’
WHEN xtype IN (‘FN’, ‘TF’, ‘IF’) THEN ‘fuction’
FROM sysobjects
WHERE xtype IN (‘FN’, ‘TF’, ‘IF’, ‘P’, ‘U’, ‘V’)
) s

Be Connected…


About Satyendra Mishra

Satyendra is a Technical Project Manager with 12+ years of experience on Project Management, Microsoft Technologies including ASP.NET, ASP.NET MVC, C#, SharePoint (On premises & Office 365), JavaScript Framework (AngularJS) and related technologies. He is a person with belief, sky is limit for a hard working and dedicated individual. That’s why he devoted himself to field of Software Development and now both are growing with each other. Every year for him turned out to be best year and he received enormous support and love from his companies and his clients from around the world. Now with vast knowledge of software development and its outsourcing process, he decided to move himself into knowledge sharing. Keep a fact in your mind about the comfort level of your clients and this will make you king/queen of your area.
View all posts by Satyendra Mishra →

Leave a Reply

Your email address will not be published. Required fields are marked *