Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSdroparticletriggers

  No additional text.


Syntax
/*
** We need to qualify sysmergearticle with pubid
*/
create procedure sys.sp_MSdroparticletriggers
    (@source_table sysname,
     @table_owner    sysname = NULL)
as
    set nocount on

    declare @instrigger             nvarchar(517)
    declare @updtrigger             nvarchar(517)
    declare @deltrigger             nvarchar(517)
    declare @downloadonlytrigger    nvarchar(517)
    declare @retcode                int
    declare @owner                    sysname
    declare @artid                    uniqueidentifier
    declare @guidstr                nvarchar(32)
    declare @islightweight            bit
    declare @qualified_name         nvarchar(517)
    declare @objid                    int

    set @owner= coalesce(@table_owner, 'dbo')

    set @qualified_name= quotename(@owner) + '.' + quotename(@source_table)

    set @objid= object_id(@qualified_name)

    -- Check whether the table is hws or lws, return success if it is neither.
    select top 1 @islightweight= lightweight, @artid= artid
        from dbo.sysmergearticles
        where objid=@objid

    if @islightweight is null return 0

    if 0=@islightweight
    begin
        exec @retcode=sys.sp_MSguidtostr @artid, @guidstr out
        if @retcode<>0 or @@ERROR<>0 return (1)

        select @instrigger = QUOTENAME(@owner) + '.MSmerge_ins_' + @guidstr
        select @updtrigger = QUOTENAME(@owner) + '.MSmerge_upd_' + @guidstr
        select @deltrigger = QUOTENAME(@owner) + '.MSmerge_del_' + @guidstr
        select @downloadonlytrigger = QUOTENAME(@owner) + '.MSmerge_downloadonly_' + @guidstr

        if object_id(@instrigger) is not NULL
        begin
            exec ('drop trigger ' + @instrigger)
            if @@ERROR<>0 return (1)
        end
        if object_id(@updtrigger) is not NULL
        begin
            exec ('drop trigger ' + @updtrigger)
            if @@ERROR<>0 return (1)
        end
        if object_id(@deltrigger) IS NOT NULL
        begin
            exec ('drop trigger ' + @deltrigger)
            if @@ERROR<>0 return (1)
        end
        if object_id(@downloadonlytrigger) IS NOT NULL
        begin
            exec ('drop trigger ' + @downloadonlytrigger)
            if @@ERROR<>0 return (1)
        end
    end -- 0=@islightweight
    else
    begin
        exec @retcode= sys.sp_MSdroplightweighttriggers @artid=@artid
        if @@error<>0 or @retcode<>0 return 1
    end

    return 0

 
Last revision 2008RTM
See also

  sp_MSaddmergetriggers (Procedure)
sp_MSarticlecleanup (Procedure)
sp_MSDropTriggerProcs (Procedure)
sp_repladdcolumn (Procedure)
sp_repldropcolumn (Procedure)
sp_vupgrade_mergeobjects (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