다음을 통해 공유


SetOptions Method

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The SetOptions method modifies configurable parameters for a Microsoft SQL Server remote or linked server.

구문

object
.SetOptions(
Option
,
Setting
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Option
    Long integer that identifies one or more options as described in Settings.

  • Setting
    When TRUE, the options identified in Option are enabled. When FALSE, the options identified in Option are disabled.

Prototype (C/C++)

HRESULT SetOptions(
SQLDMO_SRVOPTION_TYPE Options,
BOOL NewValue);

Settings

When setting the Option argument specifying multiple behaviors, combine values using an OR logical operator. Set the Option argument using these SQLDMO_SRVOPTION_TYPE values.

Constant

Value

Description

SQLDMOSrvOpt_/CollationCompatible

256

Referenced server uses ordering and character comparison identical to that used by the local server (LinkedServer object only).

SQLDMOSrvOpt_DataAccess

128

Referenced server is available to the local server as a distributed query participant (LinkedServer object only).

SQLDMOSrvOpt_DistPublisher

16

Referenced server is a publication Distributor for the local server (RemoteServer object only).

SQLDMOSrvOpt_Distributor

8

Referenced server is a replication Distributor (RemoteServer object only).

SQLDMOSrvOpt_/DynamicParameters

131072

Referenced server recognizes the ODBC-specified ? character as a parameter representation in a query statement (LinkedServer object only).

SQLDMOSrvOpt_/IndexAsAccessPath

16384

Provider-implemented indexes will be used as an access path for distributed queries against the referenced server (LinkedServer object only)

SQLDMOSrvOpt_InProcess

8192

Launches the OLE DB provider implementing the referenced data source as a COM in-process server (LinkedServer object only).

SQLDMOSrvOpt_/LevelZeroOnly

32768

When accessing the referenced server, distributed queries use only OLE DB Level 0 support (LinkedServer object only)

SQLDMOSrvOpt_/NestedQueries

65536

Referenced server supports the SELECT statement in the FROM clause of a query (LinkedServer object only).

SQLDMOSrvOpt_/NonTransacted

4096

Distributed query allows update to the referenced server regardless of the presence of transaction support (LinkedServer object only)

SQLDMOSrvOpt_Publisher

2

Referenced server publishes data to the local server (RemoteServer object only).

SQLDMOSrvOpt_RPC

1

Allows remote procedure calls made by the remote or linked server

SQLDMOSrvOpt_RPC_out

64

Referenced server accepts remote procedure calls from the local server (LinkedServer object only).

SQLDMOSrvOpt_Subscriber

4

Referenced server subscribes to replication publications on the local server (RemoteServer object only).

SQLDMOSrvOpt_Unknown

0

No options set.

SQLDMOSrvOpt_/UseRemoteCollation

1024

Collation of remote columns is used for SQL Server data sources, and the collation specified in CollationName is used for non-SQL Server data sources (LinkedServer2 object only).

주의

Setting options in error can cause unintended results. For example, when SQL Server links to an OLE DB data source, the user can indicate that the data source linked-to uses character set and collation sequence identical to that used by the linking instance of SQL Server. The user can accomplish this task using the SetOptions method of the LinkedServer object, setting Option to SQLDMOSrvOpt_CollationCompatible and setting Setting to TRUE. Distributed query uses character set and collation sequence compatibility to optimize query resolution. If the value is set in error, distributed query can return erroneous results.