Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSmerge_alterview

  No additional text.


Syntax





create procedure sys.sp_MSmerge_alterview
(
    @qual_object_name nvarchar(512) --qualified 3-part-name
    ,@objid    int
    ,@pass_through_scripts nvarchar(max)
    ,@objecttype varchar(32)
)
AS
    set nocount on
    declare @retcode int
    declare @got_merge_admin_applock bit

    select @got_merge_admin_applock = 0

    if is_member('db_owner') <> 1
    begin
        raiserror (21050, 16, -1)
        return (1)
    end

    begin tran
    save TRAN sp_MSmerge_alterview

    -- obtain the snapshot/DDL/admin proc applock to avoid having contention with snapshot
    -- Attempt to get the lock with no wait
    exec @retcode = sys.sp_MSgetmergeadminapplock @timeout = 0, -- no wait
                                                  @lockowner = N'Transaction'
    if @retcode<>0 or @@error<>0
    begin
        raiserror(21386, 16, -1, @qual_object_name)
        goto FAILURE
    end

    select @got_merge_admin_applock = 1

    --loop through schema only publications/articles
    exec @retcode = sys.sp_MSmerge_alterschemaonly @qual_object_name = @qual_object_name
                                                ,@objid = @objid
                                                ,@pass_through_scripts = @pass_through_scripts
                                                ,@objecttype = @objecttype
    if @retcode <>0 or @@ERROR<>0
        goto FAILURE

    --merge does not have table based publications/articles for now
    exec sys.sp_MSreleasemergeadminapplock @lockowner = N'Transaction'
    commit tran
    return 0

FAILURE:
    IF @@TRANCOUNT > 0
    begin
        if @got_merge_admin_applock=1
            exec sys.sp_MSreleasemergeadminapplock @lockowner = N'Transaction'
        ROLLBACK TRANSACTION sp_MSmerge_alterview
        commit tran
    end
    return 1

 
Last revision 2008RTM
See also

  sp_MSmerge_ddldispatcher (Procedure)
sp_MSmerge_passDDLcmd (Procedure)
sp_MSNonSQLDDLForSchemaDDL (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