sys.types (Transact-SQL)sys.types (Transact-SQL)
適用対象:Applies to: SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
SQL ServerSQL Server (サポートされているすべてのバージョン)
SQL ServerSQL Server (all supported versions)
Azure SQL データベースAzure SQL Database
Azure SQL データベースAzure SQL Database
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure SQL Managed InstanceAzure SQL Managed Instance
Azure Synapse AnalyticsAzure Synapse Analytics
Azure Synapse AnalyticsAzure Synapse Analytics
Parallel Data WarehouseParallel Data Warehouse
Parallel Data WarehouseParallel Data Warehouse
システム型とユーザー定義の型ごとに 1 行のデータを格納します。Contains a row for each system and user-defined type.
列名Column name | データ型Data type | 説明Description |
---|---|---|
namename | sysnamesysname | 型の名前。Name of the type. スキーマ内で一意です。Is unique within the schema. |
system_type_idsystem_type_id | tinyinttinyint | 型の内部システム型の ID。ID of the internal system-type of the type. |
user_type_iduser_type_id | intint | 型の ID です。ID of the type. データベース内で一意です。Is unique within the database. システムデータ型の場合は、 user_type_id = system_type_id ます。For system data types, user_type_id = system_type_id. |
schema_idschema_id | intint | 型が属するスキーマの ID。ID of the schema to which the type belongs. |
principal_idprincipal_id | intint | スキーマの所有者と異なる場合は、個々の所有者の ID。ID of the individual owner if different from schema owner. 既定では、スキーマに含まれるオブジェクトはスキーマの所有者によって所有されます。By default, schema-contained objects are owned by the schema owner. ただし、ALTER AUTHORIZATION ステートメントを使用して所有権を変更することによって、代替所有者を指定できます。However, an alternate owner can be specified by using the ALTER AUTHORIZATION statement to change ownership. 別の所有者がいない場合は NULL になります。NULL if there is no alternate individual owner. |
max_lengthmax_length | smallintsmallint | 型の最大長 (バイト単位)。Maximum length (in bytes) of the type. -1 = 列のデータ型は varchar (max),、 nvarchar (max),、 varbinary (max),、または xml です。-1 = Column data type is varchar(max), nvarchar(max), varbinary(max), or xml. テキスト 列の場合、 max_length 値は16になります。For text columns, the max_length value will be 16. |
有効桁数 (precision)precision | tinyinttinyint | 数値ベースの場合の型の最大有効桁数。それ以外の場合は0です。Max precision of the type if it is numeric-based; otherwise, 0. |
scalescale | tinyinttinyint | 数値ベースの場合の型の最大小数点以下桁数それ以外の場合は0です。Max scale of the type if it is numeric-based; otherwise, 0. |
collation_namecollation_name | sysnamesysname | 文字ベースの場合は、型の照合順序の名前。それ以外の場合は NULL です。Name of the collation of the type if it is character-based; other wise, NULL. |
is_nullableis_nullable | bitbit | 型は nullable です。Type is nullable. |
is_user_definedis_user_defined | bitbit | 1 = ユーザー定義型。1 = User-defined type. 0 = SQL ServerSQL Server システム データ型。0 = SQL ServerSQL Server system data type. |
is_assembly_typeis_assembly_type | bitbit | 1 = 型の実装は CLR アセンブリで定義されています。1 = Implementation of the type is defined in a CLR assembly. 0 = 型はシステムデータ型に基づいてい SQL ServerSQL Server ます。0 = Type is based on a SQL ServerSQL Server system data type. |
default_object_iddefault_object_id | intint | Sp_bindefaultを使用して型にバインドされているスタンドアロンの既定の ID。ID of the stand-alone default that is bound to the type by using sp_bindefault. 0 = 既定値は存在しません。0 = No default exists. |
rule_object_idrule_object_id | intint | Sp_bindruleを使用して型にバインドされているスタンドアロンルールの ID。ID of the stand-alone rule that is bound to the type by using sp_bindrule. 0 = ルールは存在しません。0 = No rule exists. |
is_table_typeis_table_type | bitbit | 型がテーブルであることを示します。Indicates the type is a table. |
アクセス許可Permissions
カタログ ビューでのメタデータの表示が、ユーザーが所有しているかそのユーザーが権限を許可されている、セキュリティ保護可能なメタデータに制限されます。The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. 詳細については、「 Metadata Visibility Configuration」を参照してください。For more information, see Metadata Visibility Configuration.
参照See Also
カタログ ビュー (Transact-SQL) Catalog Views (Transact-SQL)
Transact-sql)(スカラー型のカタログビュー Scalar Types Catalog Views (Transact-SQL)
ALTER AUTHORIZATION (Transact-SQL) ALTER AUTHORIZATION (Transact-SQL)
OBJECTPROPERTY (Transact-SQL) OBJECTPROPERTY (Transact-SQL)
SQL Server システム カタログに対するクエリに関してよく寄せられる質問Querying the SQL Server System Catalog FAQ