Replicates the execution of a user-defined script to the Subscribers of a specified publication.
Assembly: Microsoft.SqlServer.Rmo (in Microsoft.SqlServer.Rmo.dll)
The method is only supported for transactional and merge publications.
The script is copied to the Distributor when 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 will not be replicated. You will need to call this method again.
Using the method to post a script file for publications using File Transfer Protocol (FTP) for snapshot delivery is only supported for SQL Server Subscribers.
The 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 is equivalent to executing the sp_addscriptexec (Transact-SQL) stored procedure.