Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 SCHEMATA (Transact-SQL)
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
Other versions are also available for the following:
SQL Server 2008 Books Online (October 2009)
SCHEMATA (Transact-SQL)

Returns one row for each schema in the current database. To retrieve information from these views, specify the fully qualified name of INFORMATION_SCHEMA.view_name. To retrieve information about all databases in an instance of SQL Server, query the sys.databases (Transact-SQL) catalog view.

Column name Data type Description

CATALOG_NAME

sysname

Name of current database

SCHEMA_NAME

nvarchar(128)

Returns the name of the schema.

SCHEMA_OWNER

nvarchar(128)

Schema owner name.

ms182642.note(en-us,SQL.100).gifImportant:
Do not use INFORMATION_SCHEMA views to determine the schema of an object. The only reliable way to find the schema of an object is to query the sys.objects catalog view or use the OBJECT_SCHEMA_NAME function.

DEFAULT_CHARACTER_SET_CATALOG

varchar(6)

Always returns NULL.

DEFAULT_CHARACTER_SET_SCHEMA

varchar(3)

Always returns NULL.

DEFAULT_CHARACTER_SET_NAME

sysname

Returns the name of the default character set.

The following example returns information about each schema in the database.

USE AdventureWorks;
GO

SELECT *
FROM INFORMATION_SCHEMA.SCHEMATA;
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker