DOMAINS (Transact-SQL)
SQL Server 2008 Books Online (November 2009)
DOMAINS (Transact-SQL)

Returns one row for each alias data type that can be accessed by the current user in the current database.

To retrieve information from these views, specify the fully qualified name of INFORMATION_SCHEMA.view_name.

Column name Data type Description

DOMAIN_CATALOG

nvarchar(128)

Database in which the alias data type exists.

DOMAIN_SCHEMA

nvarchar(128)

Name of the schema that contains the alias data type.

ms190371.note(en-us,SQL.100).gifImportant:
Do not use INFORMATION_SCHEMA views to determine the schema of a data type. The only reliable way to find the schema of a type is to use the TYPEPROPERTY function.

DOMAIN_NAME

sysname

Alias data type.

DATA_TYPE

sysname

System-supplied data type.

CHARACTER_MAXIMUM_LENGTH

int

Maximum length, in characters, for binary data, character data, or text and image data.

-1 for xml and large-value type data. Otherwise, NULL is returned. For more information, see Data Types (Transact-SQL).

CHARACTER_OCTET_LENGTH

int

Maximum length, in bytes, for binary data, character data, or text and image data.

-1 for xml and large-value type data. Otherwise, NULL is returned.

COLLATION_CATALOG

varchar(6)

Always returns NULL.

COLLATION_SCHEMA

varchar(3)

Always returns NULL.

COLLATION_NAME

nvarchar(128)

Returns the unique name for the sort order if the column is character data or text data type. Otherwise, NULL is returned.

CHARACTER_SET_CATALOG

varchar(6)

Returns master. This indicates the database in which the character set is located, if the column is character data or text data type. Otherwise, NULL is returned.

CHARACTER_SET_SCHEMA

varchar(3)

Always returns NULL.

CHARACTER_SET_NAME

nvarchar(128)

Returns the unique name for the character set if this column is character data or text data type. Otherwise, NULL is returned.

NUMERIC_PRECISION

tinyint

Precision of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.

NUMERIC_PRECISION_RADIX

smallint

Precision radix of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.

NUMERIC_SCALE

tinyint

Scale of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.

DATETIME_PRECISION

smallint

Subtype code for datetime and ISO interval data type. For other data types, this column returns a NULL.

DOMAIN_DEFAULT

nvarchar(4000)

Actual text of the definition Transact-SQL statement.

Examples

The following example returns information about each alias data type that is defined in the database.

USE AdventureWorks;
GO

SELECT *
FROM INFORMATION_SCHEMA.DOMAINS;
See Also

Reference

System Views (Transact-SQL)
Information Schema Views (Transact-SQL)
sys.syscharsets (Transact-SQL)
sys.sql_modules (Transact-SQL)
sys.configurations (Transact-SQL)
sys.types (Transact-SQL)

Other Resources

Querying the SQL Server System Catalog

Help and Information

Getting SQL Server 2008 Assistance
© 2010 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View