Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Difference between INFORMATION_SCHEMA and SYS schema in SQL SERVER

In SQL Server, both INFORMATION_SCHEMA and sys are schema-based views that provide metadata about database objects. However, there are some differences between the two:

  1. Content: The INFORMATION_SCHEMA views provide a more standardized way of accessing metadata, while the sys views provide more detailed information about the database objects.
  2. Compatibility: The INFORMATION_SCHEMA views are part of the SQL standard, so they are more compatible with other database management systems. On the other hand, the sys views are specific to SQL Server.
  3. Customization: The INFORMATION_SCHEMA views are read-only, so they cannot be modified. The sys views can be customized using user-defined views, stored procedures, and functions.
  4. Performance: The sys views are generally faster than the INFORMATION_SCHEMA views, as they use internal system tables that are optimized for performance.

In summary, the INFORMATION_SCHEMA views provide a more standardized way of accessing metadata, while the sys views provide more detailed and customizable information specific to SQL Server. Both can be useful in different scenarios, depending on the requirements of the task at hand.

Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Daniel Adeniji
Daniel Adeniji
1 year ago

Mr. Raj:-

You have an interesting take on saying that queries against the sys schema is likely a bit faster than corresponding queries against the INFORMATION_SCHEMA.

Can you please direct us to other resources that speak to specific queries that were tested and how the correspondent benchmark tests?

Nice well-written and concise post.

1
0
Would love your thoughts, please comment.x
()
x