Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSunregistersubscription

  No additional text.


Syntax

create procedure sys.sp_MSunregistersubscription
(
    @publisher         sysname = NULL,
    @publisher_db     sysname = NULL,
    @publication     sysname = NULL,
    @subscriber     sysname = NULL,
    @subscriber_db     sysname = NULL
)
AS
BEGIN
    /*
    ** Drop the corresponding registry entry for MobileSync
    */
    declare @enabled    int
    declare    @retcode     int
    declare @regkey        nvarchar(1000)

    select @retcode = 0

    exec @retcode = sys.sp_MSreplcheck_subscribe

    if @@error <> 0 or @retcode <> 0
    BEGIN
        RETURN 1
    END

    -- Mark enabled_for_syncmgr bit before trying to delete the key
    -- If the row exists in MSreplication_properties table,
    -- set enabled_for_syncmgr bit
    -- The logic need to be here because UI call this sp directly.
    IF OBJECT_ID('MSsubscription_properties') IS NOT NULL
    BEGIN
        UPDATE    MSsubscription_properties
        SET        enabled_for_syncmgr = 0
        WHERE    UPPER(publisher) = UPPER(@publisher)
          AND    publisher_db =  @publisher_db
          AND    publication = @publication

        IF @@ERROR <> 0
            RETURN 1
    END

    -- regdelete returns 'Access Denied' message if key does not exist; check before delete
    EXEC sys.sp_MSsubscription_enabled_for_syncmgr    @publisher,
                                                    @publisher_db,
                                                    @publication,
                                                    @subscriber,
                                                    @subscriber_db,
                                                    @enabled OUT,
                                                    @regkey OUT
    IF @@ERROR <> 0
        RETURN 1

    IF @enabled = 1 AND LEN(@regkey) > 0
    BEGIN
        EXECUTE @retcode = master.dbo.xp_regdeletekey 'HKEY_LOCAL_MACHINE', @regkey

        IF @@error != 0 OR @retcode != 0
        BEGIN
            return 1
        END
    END

    return 0
END

 
Last revision 2008RTM
See also

  sp_dropmergepullsubscription (Procedure)
sp_dropmergesubscription (Procedure)
sp_droppullsubscription (Procedure)
sp_MSrepl_dropsubscription (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