sp_setdefaultdatatypemapping (Transact-SQL)

適用対象:SQL Server

SQL Server と SQL Server 以外のデータベース管理システム (DBMS) の間の既存のデータ型マッピングを既定としてマークします。 このストアド プロシージャは、任意のデータベースのディストリビューターで実行されます。

Transact-SQL 構文表記規則

構文

sp_setdefaultdatatypemapping
    [ [ @mapping_id = ] mapping_id ]
    [ , [ @source_dbms = ] N'source_dbms' ]
    [ , [ @source_version = ] 'source_version' ]
    [ , [ @source_type = ] N'source_type' ]
    [ , [ @source_length_min = ] source_length_min ]
    [ , [ @source_length_max = ] source_length_max ]
    [ , [ @source_precision_min = ] source_precision_min ]
    [ , [ @source_precision_max = ] source_precision_max ]
    [ , [ @source_scale_min = ] source_scale_min ]
    [ , [ @source_scale_max = ] source_scale_max ]
    [ , [ @source_nullable = ] source_nullable ]
    [ , [ @destination_dbms = ] N'destination_dbms' ]
    [ , [ @destination_version = ] 'destination_version' ]
    [ , [ @destination_type = ] N'destination_type' ]
    [ , [ @destination_length = ] destination_length ]
    [ , [ @destination_precision = ] destination_precision ]
    [ , [ @destination_scale = ] destination_scale ]
    [ , [ @destination_nullable = ] destination_nullable ]
[ ; ]

引数

[ @mapping_id = ] mapping_id

既存のデータ型マッピングを識別します。 @mapping_idは int で、既定値は NULL. @mapping_idを指定した場合、再メインパラメーターは必要ありません。

[ @source_dbms = ] N'source_dbms'

データ型のマップ元となる DBMS の名前。 @source_dbmsは sysname であり、次のいずれかの値を指定できます。

Value 説明
MSSQLSERVER ソースは SQL Server データベースです。
ORACLE マップ元は Oracle データベース。
NULL (既定)

@mapping_idの場合NULL、このパラメーターを指定する必要があります。

[ @source_version = ] 'source_version'

ソース DBMS のバージョン番号。 @source_versionは varchar(10) で、既定値は NULL.

[ @source_type = ] N'source_type'

ソース DBMS のデータ型。 @source_typeは sysname で、既定値は NULL. mapping_idの場合NULL、このパラメーターを指定する必要があります。

[ @source_length_min = ] source_length_min

ソース DBMS のデータ型の最小長。 @source_length_minは bigint で、既定値は NULL.

[ @source_length_max = ] source_length_max

ソース DBMS のデータ型の最大長。 @source_length_maxは bigint で、既定値は NULL.

[ @source_precision_min = ] source_precision_min

ソース DBMS のデータ型の最小有効桁数。 @source_precision_minは bigint で、既定値は NULL.

[ @source_precision_max = ] source_precision_max

ソース DBMS のデータ型の最大有効桁数。 @source_precision_maxは bigint で、既定値は NULL.

[ @source_scale_min = ] source_scale_min

ソース DBMS のデータ型の最小スケール。 @source_scale_minは int で、既定値は NULL.

[ @source_scale_max = ] source_scale_max

ソース DBMS のデータ型の最大スケール。 @source_scale_maxは int で、既定値は NULL.

[ @source_nullable = ] source_nullable

ソース DBMS のデータ型が値 NULLをサポートするかどうかを指定します。 @source_nullableはビットで、既定値は NULL. 1 は、値がサポートされていることを NULL 意味します。

[ @destination_dbms = ] N'destination_dbms'

宛先 DBMS の名前。 @destination_dbmsは sysname であり、次のいずれかの値を指定できます。

Value 説明
MSSQLSERVER 変換先は SQL Server データベースです。
ORACLE 変換先は Oracle データベースです。
DB2 マップ先は IBM DB2 データベース。
SYBASE 変換先は Sybase データベースです。
NULL (既定)

[ @destination_version = ] 'destination_version'

マップ先 DBMS の製品バージョンです。 @destination_versionは varchar(10) で、既定値は NULL.

[ @destination_type = ] N'destination_type'

宛先 DBMS に一覧表示されているデータ型。 @destination_typeは sysname で、既定値は NULL.

[ @destination_length = ] destination_length

マップ先 DBMS のデータ型の長さです。 @destination_lengthは bigint で、既定値は NULL.

[ @destination_precision = ] destination_precision

宛先 DBMS のデータ型の有効桁数。 @destination_precisionは bigint で、既定値は NULL.

[ @destination_scale = ] destination_scale

マップ先 DBMS のデータ型の小数点以下桁数です。 @destination_scaleは int で、既定値は NULL.

[ @destination_nullable = ] destination_nullable

宛先 DBMS のデータ型が値 NULLをサポートするかどうかを指定します。 @destination_nullableはビットで、既定値は NULL. 1 は、値がサポートされていることを NULL 意味します。

リターン コードの値

0 (成功) または 1 (失敗)。

解説

sp_setdefaultdatatypemapping は、SQL Server と SQL Server 以外の DBMS 間のすべての種類のレプリケーションで使用されます。

既定のデータ型マッピングは、指定した DBMS を含むすべてのレプリケーション トポロジに適用されます。

アクセス許可

sysadmin 固定サーバー ロールのメンバーのみが実行sp_setdefaultdatatypemappingできます。