Skip to main content
updated catalog view query
Source Link
user37701
user37701
SELECT *  
FROM sys.all_views
WHERE schema_id[schema_id] = 4 andAND name[name] NOT LIKE 'dm%' andAND name[object_id] NOT LIKEIN 'sys%'(-212,-211,-210,-209,-208,-207,-206,-205,-204,-203,-202,-201,-200,-199,-198,-197,-196,-195,-194,-193,-192,-143,-142,-141,-140,-139,-138,-137,-136,-135,-134,-133,-132,-131,-130,-129,-106,-105)
ORDER BY [name] ASC
SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%' and name NOT LIKE 'sys%'
SELECT * 
FROM sys.all_views
WHERE [schema_id] = 4 AND [name] NOT LIKE 'dm%' AND [object_id] NOT IN (-212,-211,-210,-209,-208,-207,-206,-205,-204,-203,-202,-201,-200,-199,-198,-197,-196,-195,-194,-193,-192,-143,-142,-141,-140,-139,-138,-137,-136,-135,-134,-133,-132,-131,-130,-129,-106,-105)
ORDER BY [name] ASC
adding filter predicate to show only catalog views
Source Link
user37701
user37701

Here's the difference:

  • sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

  • sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))

Inside the catalog view you can see they are using the system table sys.sysschobjs:

CREATE VIEW sys.system_objects 
AS   
SELECT o.name,    
o.id AS object_id,    
convert(int, null) AS principal_id,    
o.nsid AS schema_id,    convert(int, 0) AS parent_object_id,    
o.type,    
n.name AS type_desc,    
o.created AS create_date,    
o.modified AS modify_date,    
convert(bit, 1) AS is_ms_shipped,    
convert(bit, 0) AS is_published,    
convert(bit, 0) AS is_schema_published   
FROM sys.sysschobjs o   
LEFT JOIN sys.syspalnames n ON n.class = 'OBTY' AND n.value = o.type   WHERE has_access('SO', o.id) = 1 

Extracting from sys.objects you can find the sys.sysschobjs

SELECT name, type_desc FROM sys.objects
WHERE name = 'sysschobjs' 

The system table below needs DAC to access

+------------+--------------+
| **name**       | **type_desc**    |
+------------+--------------+
| sysschobjs | SYSTEM_TABLE |
+------------+--------------+

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%' and name NOT LIKE 'sys%'

And Microsoft docs here

you can check out other system tables and compare like:

  • sys.databases (SQL Server 2005 and up)
  • sys.sysdatabases (SQL Server 2000)

Microsoft doesn't encourage us to use the old system tables. The old compatibility views don't have the new metadata related to higher version of SQL Server features (eg. partitioning, etc). Only use it on SQL Server 2000 as Microsoft will remove it from future release of SQL Server.

Here's the difference:

  • sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

  • sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))

Inside the catalog view you can see they are using the system table sys.sysschobjs:

CREATE VIEW sys.system_objects 
AS   
SELECT o.name,    
o.id AS object_id,    
convert(int, null) AS principal_id,    
o.nsid AS schema_id,    convert(int, 0) AS parent_object_id,    
o.type,    
n.name AS type_desc,    
o.created AS create_date,    
o.modified AS modify_date,    
convert(bit, 1) AS is_ms_shipped,    
convert(bit, 0) AS is_published,    
convert(bit, 0) AS is_schema_published   
FROM sys.sysschobjs o   
LEFT JOIN sys.syspalnames n ON n.class = 'OBTY' AND n.value = o.type   WHERE has_access('SO', o.id) = 1 

Extracting from sys.objects you can find the sys.sysschobjs

SELECT name, type_desc FROM sys.objects
WHERE name = 'sysschobjs' 

The system table below needs DAC to access

+------------+--------------+
| **name**       | **type_desc**    |
+------------+--------------+
| sysschobjs | SYSTEM_TABLE |
+------------+--------------+

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%'

And Microsoft docs here

you can check out other system tables and compare like:

  • sys.databases (SQL Server 2005 and up)
  • sys.sysdatabases (SQL Server 2000)

Microsoft doesn't encourage us to use the old system tables. The old compatibility views don't have the new metadata related to higher version of SQL Server features (eg. partitioning, etc). Only use it on SQL Server 2000 as Microsoft will remove it from future release of SQL Server.

Here's the difference:

  • sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

  • sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))

Inside the catalog view you can see they are using the system table sys.sysschobjs:

CREATE VIEW sys.system_objects 
AS   
SELECT o.name,    
o.id AS object_id,    
convert(int, null) AS principal_id,    
o.nsid AS schema_id,    convert(int, 0) AS parent_object_id,    
o.type,    
n.name AS type_desc,    
o.created AS create_date,    
o.modified AS modify_date,    
convert(bit, 1) AS is_ms_shipped,    
convert(bit, 0) AS is_published,    
convert(bit, 0) AS is_schema_published   
FROM sys.sysschobjs o   
LEFT JOIN sys.syspalnames n ON n.class = 'OBTY' AND n.value = o.type   WHERE has_access('SO', o.id) = 1 

Extracting from sys.objects you can find the sys.sysschobjs

SELECT name, type_desc FROM sys.objects
WHERE name = 'sysschobjs' 

The system table below needs DAC to access

+------------+--------------+
| **name**       | **type_desc**    |
+------------+--------------+
| sysschobjs | SYSTEM_TABLE |
+------------+--------------+

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%' and name NOT LIKE 'sys%'

And Microsoft docs here

you can check out other system tables and compare like:

  • sys.databases (SQL Server 2005 and up)
  • sys.sysdatabases (SQL Server 2000)

Microsoft doesn't encourage us to use the old system tables. The old compatibility views don't have the new metadata related to higher version of SQL Server features (eg. partitioning, etc). Only use it on SQL Server 2000 as Microsoft will remove it from future release of SQL Server.

rearrange my answer for order.
Source Link
user37701
user37701
  • sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

    sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%'

And Microsoft docs here

  • sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))

    sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))

+------------+--------------+
| **name**       | **type_desc**    |
+------------+--------------+
| sysschobjs | SYSTEM_TABLE |
+------------+--------------+

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%'

And Microsoft docs here

  • sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%'

And Microsoft docs here

  • sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))
+------------+--------------+
| **name**       | **type_desc**    |
+------------+--------------+
| sysschobjs | SYSTEM_TABLE |
+------------+--------------+
  • sys.sysobjects is an old SQL Server 2000 system table (compatibility view). Starting SQL Server 2005, Microsoft introduced a new set of views called catalog views as a replacement to compatibility views. Compatibility views are still in SQL Server for backward compatibility (Microsoft decided to leave the old views to not break some internal codes).

  • sys.system_objects is a catalog view. You can check the object definition by executing this: SELECT OBJECT_DEFINITION(OBJECT_ID('sys.system_objects'))

+------------+--------------+
| **name**       | **type_desc**    |
+------------+--------------+
| sysschobjs | SYSTEM_TABLE |
+------------+--------------+

You can find the catalog views by executing:

SELECT * FROM sys.all_views
WHERE schema_id = 4 and name NOT LIKE 'dm%'

And Microsoft docs here

fix confusing word
Source Link
user37701
user37701
Loading
added 4 characters in body
Source Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496
Loading
improve answer with details
Source Link
user37701
user37701
Loading
Source Link
user37701
user37701
Loading