Getting Difference Between sys.all_objects & sys.objects in sql server


This query returns all the rows which is different between both tables based on type_desc.


select 'table1' as tblName, * from (select distinct type_desc from sys.all_objects
except
select distinct type_desc from sys.objects) x
union all
select 'table2' as tblName, *  from (select distinct type_desc from sys.objects
except
select distinct type_desc from sys.all_objects) x

OUTPUT:

tblName type_desc

table1 CLR_STORED_PROCEDURE
table1 EXTENDED_STORED_PROCEDURE
table1 SQL_INLINE_TABLE_VALUED_FUNCTION

Thanks :)