Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_check_for_sync_trigger

  No additional text.


Syntax
create procedure sys.sp_check_for_sync_trigger
(
    @tabid int,
    @trigger_op char(10) = NULL OUTPUT,
    @fonpublisher bit = 0 -- 0 = on Subscriber, 1 = publisher
)
as
begin
    declare @retcode int

    select @trigger_op = NULL
    if (@fonpublisher = 0)
    begin
        declare @ins_trigid int
                    ,@upd_trigid int
                    ,@del_trigid int
        
        -- get the id for subscriber sync tran triggers
        
        select @ins_trigid = object_id from sys.objects where
            type = N'TR' and name like N'trg_MSsync_ins_%' and parent_object_id = @tabid
        select @upd_trigid = object_id from sys.objects where
            type = N'TR' and name like N'trg_MSsync_upd_%' and parent_object_id = @tabid
        select @del_trigid = object_id from sys.objects where
            type = N'TR' and name like N'trg_MSsync_del_%' and parent_object_id = @tabid
        if trigger_nestlevel( @ins_trigid ) > 0
        begin
             select @trigger_op = 'ins'
             return 1
        end
        else    -- if nestlevel of insert trigger on same table > 0 then bail
        if trigger_nestlevel( @upd_trigid ) > 0
        begin
             select @trigger_op = 'upd'
             return 1
        end
        else
        if trigger_nestlevel( @del_trigid ) > 0
        begin
             select @trigger_op = 'del'
             return 1
        end
    end
    else
    begin
        declare @ver_trigid int
        
        -- get the id for publisher version update trigger
        
        select @ver_trigid = object_id from sys.objects where
            type = N'TR' and name like N'sp_MSsync_upd_trig_%' and parent_object_id = @tabid
        if trigger_nestlevel( @ver_trigid ) > 0
        begin
             select @trigger_op = 'upd'
             return 1
        end
    end
    
    -- no trigger was selected
    
    return 0
end

 
Last revision 2008RTM
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