I have database Test1
in SQL Server 2008 R2. On the live server I took backup from there and restore it at our local machine as Test2
and added som
Use this script. It is not using switch case statement.
USE [MyDatabase]
GO
select distinct type_desc as 'Type Description', Count from
(SELECT 'Count' = COUNT(*), type FROM sys.objects GROUP BY type) as dbstatistics
left join sys.objects on dbstatistics.type = sys.objects.type ORDER BY Count desc
GO