Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSupsertschemachange

  No additional text.


Syntax

create procedure sys.sp_MSupsertschemachange(
    @pubid          uniqueidentifier,
    @artid          uniqueidentifier = NULL, /* Can be NULL for directory commands */
    @schemaversion  int,
    @schemaguid     uniqueidentifier,
    @schematype     int,
    @schematext     nvarchar(2000)
    )
as
    /*
    ** Check to see if current publication has permission
    */
    declare @retcode int

    if ({fn ISPALUSER(@pubid)} <> 1)
    begin
        if (@pubid is NULL)
        begin
            RAISERROR (21723, 16, -1, 'sp_MSupsertschemachange')
            return 1
        end
        else
        begin
            RAISERROR (14126, 11, -1)
            return 1
        end
    end

    /* Parameter validation */
    if (@schemaversion is null)
        begin
        RAISERROR(14043, 16, -1, '@schemaversion', 'sp_MSupsertschemachange')
        return (1)
        end

    if @artid is NULL
        update dbo.sysmergeschemachange set schemaversion = @schemaversion, schemaguid = @schemaguid
            where pubid = @pubid
            and schematype = @schematype
            and schematext = @schematext
    else
        update dbo.sysmergeschemachange set schemaversion = @schemaversion, schemaguid = @schemaguid
            where pubid = @pubid
            and artid = @artid
            and schematype = @schematype
            and schematext = @schematext

    if @@rowcount = 0
    begin
        exec @retcode = sys.sp_MSinsertschemachange @pubid=@pubid, @artid=@artid, @schemaversion=@schemaversion,
                                                    @schemaguid=@schemaguid, @schematype = @schematype,
                                                    @schematext=@schematext
        if @@error<>0 or @retcode <> 0
                return 1
    end
    else
    begin
        declare @subid uniqueidentifier

        select @subid = subid from dbo.sysmergesubscriptions
            where UPPER(subscriber_server) collate database_default = UPPER(publishingservername()) collate database_default
               and db_name = DB_NAME() and pubid = @pubid

        update dbo.sysmergesubscriptions set schemaversion = @schemaversion, schemaguid = @schemaguid
            where subid = @subid and (schemaversion<@schemaversion or schemaversion is NULL)
        if @@error <> 0
        begin
            RAISERROR(21305 , 16, -1)
            return (1)
        end
    end
    return (0)

 
Last revision 2008RTM
See also

  sp_MSdrop_rlrecon (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