HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Why shouldn't INFORMATION_SCHEMA views be used to determine the schema of an object?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
whytheusedinformation_schemaviewsshouldndetermineobjectschema

Problem

According to MS-DOCS about System information schema views, the schema columns definition have a warning note that says:


Important Do not use INFORMATION_SCHEMA views to determine the schema of an object. The only reliable way to find the schema of a
object is to query the sys.objects catalog view.

Why can't INFORMATION_SCHEMA views be used to determine the schema of an object?

Is this information erroneous?

Solution

Yes, the statement there is inaccurate. I talk about this in this blog post (and complained about it in this ancient Connect item), where I implore people to use the sys catalog views over INFORMATION_SCHEMA:


The warning really should state that the INFORMATION_SCHEMA views are incomplete; the wording above implies that they might be incorrect, which in itself is incorrect.

In 2011, they said:


Hi Aaron,

That particular wording has been in the topic since 2005. But, I see your point. We'll revist the wording and try to make it more clear.

Now that we can submit pull requests for suggested changes to the documentation, it might be time for someone to make them pay attention to it again. 13 years is long enough.

Context

StackExchange Database Administrators Q#210629, answer score: 9

Revisions (0)

No revisions yet.