共用方式為


Publication.ReplicateUserDefinedScript Method

Replicates the execution of a user-defined script to the Subscribers of a specified publication.

命名空間: Microsoft.SqlServer.Replication
組件: Microsoft.SqlServer.Rmo (in microsoft.sqlserver.rmo.dll)

語法

'宣告
Public Sub ReplicateUserDefinedScript ( _
    scriptFilePath As String _
)
public void ReplicateUserDefinedScript (
    string scriptFilePath
)
public:
void ReplicateUserDefinedScript (
    String^ scriptFilePath
)
public void ReplicateUserDefinedScript (
    String scriptFilePath
)
public function ReplicateUserDefinedScript (
    scriptFilePath : String
)

參數

  • scriptFilePath
    A String value that specifies the file name and full path to the Transact-SQL script file.

例外

例外類型 狀況
ApplicationException

The server is not running SQL Server 2000 or later.

ArgumentException

The passed String value is null, empty, or too long, or the path is not a valid path.

備註

The ReplicateUserDefinedScript method is only supported for transactional and merge publications.

The script is copied to the Distributor when ReplicateUserDefinedScript is first invoked. The Distribution Agent or the Merge Agent then applies the copy at the Distributor to the Subscriber. Any modifications to the script after ReplicateUserDefinedScript will not be replicated. You will need to call this method again.

Using the ReplicateUserDefinedScript method to post a script file for publications using File Transfer Protocol (FTP) for snapshot delivery is only supported for SQL Server Subscribers.

The ReplicateUserDefinedScript method can only be called by members of the sysadmin fixed server role at the Publisher or by members of the db_owner fixed database role on the publication database.

Calling ReplicateUserDefinedScript is equivalent to executing the sp_addscriptexec (Transact-SQL) stored procedure.

The ReplicateUserDefinedScript method is available with SQL Server 2000, and SQL Server 2005.

This namespace, class, or member is supported only in version 2.0 of the .NET Framework.

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

Publication Class
Publication Members
Microsoft.SqlServer.Replication Namespace