Use the CREATE USER MAPPING statement to map a federated authorization
ID to a remote Microsoft SQL Server user ID and password.
This topic provides a complete example with the required parameters, and an
example that shows you how to use the DB2 special register USER with the CREATE
USER MAPPING statement.
The following example shows how to map a federated authorization
ID to a Microsoft SQL Server remote server user ID and
password:
CREATE USER MAPPING FOR elizabeth SERVER sqlserver
OPTIONS (REMOTE_AUTHID 'liz', REMOTE_PASSWORD 'abc123')
- elizabeth
- Specifies the authorization ID that you are mapping to a remote user ID
and password, which are defined at the Microsoft SQL Server remote server.
- SERVER sqlserver
- Specifies the server definition name that you registered in the CREATE
SERVER statement for the Microsoft SQL Server remote server.
- REMOTE_AUTHID 'liz'
- Specifies the remote user ID to which you are mapping elizabeth.
The value is case-sensitive, unless you set the FOLD_ID server option to 'U'
or 'L' in the CREATE SERVER statement.
- REMOTE_PASSWORD 'abc123'
- Specifies the remote password that is associated with 'liz'.
The value is case-sensitive, unless you set the FOLD_PW server option to 'U'
or 'L' in the CREATE SERVER statement.
DB2 special register USER
You can use the DB2 special
register USER to map the authorization ID of the person who is issuing the
CREATE USER MAPPING statement to the remote user ID that is specified in the
REMOTE_AUTHID option.
The following example shows a CREATE USER MAPPING
statement that includes the special register USER:
CREATE USER MAPPING FOR USER SERVER sqlserver
OPTIONS (REMOTE_AUTHID 'liz', REMOTE_PASSWORD 'abc123');