Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSscript_delete_statement

  No additional text.


Syntax
create procedure sys.sp_MSscript_delete_statement
(
    @publication sysname,
    @article     sysname,
    @objid int,
    @artid int,
    @queued_pub bit = 0
)
as
BEGIN
    declare @cmd          nvarchar(4000)
                ,@qualname     nvarchar(517)
                ,@hfilterprocid int
                ,@sync_objid int

    
    -- Check if we have horizontal partition filter
    
    select @hfilterprocid = filter, @sync_objid = sync_objid from dbo.sysarticles where artid = @artid
    if (@hfilterprocid = 0)
    begin
        
        -- horizontal partional filter not defined, the qualified name should be the source object
        
        exec sys.sp_MSget_qualified_name @objid, @qualname OUTPUT
    end
    else
    begin
        
        -- horizontal partional filter not defined, the qualified name should be the view object
        
        exec sys.sp_MSget_qualified_name @sync_objid, @qualname OUTPUT
    end
    
    -- start scripting
    
    select @cmd = N'
    ' + N'
    ' + N'-- detection/conflict resolution stage
    ' + N'--'
    
    -- queued specific scripting
    
    if (@queued_pub = 1)
    begin
        select @cmd = @cmd + N'
    if (@execution_mode = @QPubWins)
        save tran cftpass
    '
    end
    insert into #proctext(procedure_text) values( @cmd )
    
    -- script delete statement
    
    select @cmd = N'
    delete ' + @qualname
    insert into #proctext(procedure_text) values( @cmd )
    exec sys.sp_MSscript_where_clause @objid, @artid, 'upd version', 'msrepl_tran_version', 4
    
    -- continue with scripting
    
    select @cmd = N'
    select @rowcount = @@ROWCOUNT, @error = @@ERROR
    '
    
    -- queued specific scripting
    
    if (@queued_pub = 1)
    begin
        select @cmd = @cmd + N'
    if (@execution_mode = @QPubWins)
        rollback tran cftpass
    '
    end
    insert into #proctext(procedure_text) values( @cmd )
    
    -- all done
    
    return 0
END

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_MSscript_sync_del_proc (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