Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSfixupftpinfo

  No additional text.


Syntax

create procedure sys.sp_MSfixupftpinfo (
    @publisher sysname,
    @publisher_db sysname,
    @publication sysname,
    @ftp_address sysname,         -- default null
    @ftp_port int,                -- default null
    @ftp_login sysname,           -- default null
    @ftp_password nvarchar(524),  -- default null
    @subscription_type int,
    @force_null bit
    )
AS
    DECLARE @local_ftp_address sysname
    DECLARE @local_ftp_port sysname
    DECLARE @local_ftp_login sysname
    DECLARE @local_ftp_password nvarchar(524)
    DECLARE @retcode INT

    IF @ftp_address IS NULL AND @ftp_port IS NULL AND
       @ftp_login IS NULL AND @ftp_password IS NULL AND
       @force_null = 0
    BEGIN
        -- Parameters are unspecifed, try to inherit values from
        -- shared susbcriptions
        SELECT TOP 1 @local_ftp_address = ftp_address,
                     @local_ftp_port = ftp_port,
                     @local_ftp_login = ftp_login,
                     @local_ftp_password = ftp_password
          FROM MSsubscription_properties sp
          JOIN MSreplication_subscriptions rs
            ON UPPER(sp.publisher) = UPPER(rs.publisher)
           AND sp.publisher_db = rs.publisher_db
           AND rs.subscription_type = @subscription_type
           AND rs.independent_agent = 0
         WHERE UPPER(sp.publisher) = UPPER(@publisher)
           AND sp.publisher_db = @publisher_db
           AND sp.publication <> @publication
        IF @@ROWCOUNT > 0
        BEGIN
           -- Inherit the values from other shared subscriptions
           UPDATE MSsubscription_properties SET
            ftp_address = @local_ftp_address,
            ftp_port = @local_ftp_port,
            ftp_login = @local_ftp_login,
            ftp_password = @local_ftp_password
            WHERE UPPER(publisher) = UPPER(@publisher)
              AND publisher_db = @publisher_db
              AND publication = @publication
        END
    END
    ELSE
    BEGIN
        EXEC @retcode = sys.sp_MSupdatesharedagentproperties
           @publisher = @publisher,
           @publisher_db = @publisher_db,
           @publication = @publication,
           @property = N'ftp_address',
           @strvalue = @ftp_address,
           @subscription_type = @subscription_type

        IF @retcode <> 0 OR @@ERROR <> 0
            GOTO FixupFailure

        EXEC @retcode = sys.sp_MSupdatesharedagentproperties
           @publisher = @publisher,
           @publisher_db = @publisher_db,
           @publication = @publication,
           @property = N'ftp_port',
           @intvalue = @ftp_port,
           @subscription_type = @subscription_type

        IF @retcode <> 0 OR @@ERROR <> 0
            GOTO FixupFailure

        EXEC @retcode = sys.sp_MSupdatesharedagentproperties
           @publisher = @publisher,
           @publisher_db = @publisher_db,
           @publication = @publication,
           @property = N'ftp_login',
           @strvalue = @ftp_login,
           @subscription_type = @subscription_type

        IF @retcode <> 0 OR @@ERROR <> 0
            GOTO FixupFailure
        EXEC @retcode = sys.sp_MSupdatesharedagentproperties
           @publisher = @publisher,
           @publisher_db = @publisher_db,
           @publication = @publication,
           @property = N'ftp_password',
           @strvalue = @ftp_password,
           @subscription_type = @subscription_type

        IF @retcode <> 0 OR @@ERROR <> 0
            GOTO FixupFailure
    END

    RETURN 0

FixupFailure:
    RETURN 1


 
Last revision 2008RTM
See also

  sp_MSfixupsharedagentproperties (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash