Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSdrop_snapshot_dirs

  No additional text.


Syntax
CREATE PROCEDURE sys.sp_MSdrop_snapshot_dirs
as
begin
    declare @retcode int
    declare @snapshot_bit int
    declare @directory_type int
    declare @alt_directory_type int
    declare @publisher_database_id int

    declare @dir nvarchar(512)
    declare @command_id int
    declare @xact_seqno varbinary(16)

    select @snapshot_bit = 0x80000000
    select @directory_type = 7
    select @alt_directory_type = 25

    -- Sysadmin check
    if (isnull(is_srvrolemember('sysadmin'),0) = 0)
    begin
        raiserror(14260, 16, -1)
        return (1)
    end

    
    -- security check
    -- sysadmin check is done in sp_MSreplremoveuncdir
    
    declare  hCdirs  CURSOR LOCAL FAST_FORWARD FOR select CONVERT(nvarchar(512), command),
		xact_seqno, command_id, publisher_database_id
		from MSrepl_commands where
		((type & ~@snapshot_bit) = @directory_type) or
        ((type & ~@snapshot_bit) = @alt_directory_type)
	for read only

    open hCdirs
    fetch hCdirs into @dir, @xact_seqno, @command_id, @publisher_database_id
    while (@@fetch_status <> -1)
    begin
        
        -- Need to map unc to local drive for access problem
        -- Security check is done in sp_MSreplremoveuncdir
        
        exec @retcode = sys.sp_MSreplremoveuncdir @dir
        /* Abort the operation if the delete fails */
        if (@retcode <> 0 or @@error <> 0)
            return (1)

        delete MSrepl_commands where
        	publisher_database_id = @publisher_database_id and
        	xact_seqno = @xact_seqno and
        	command_id = @command_id

        fetch hCdirs into @dir, @xact_seqno, @command_id, @publisher_database_id
    end
    close hCdirs
    deallocate hCdirs
end

 
Last revision 2008RTM
See also

  sp_dropdistributiondb (Procedure)
sp_instdist (Procedure)
sp_MSfast_delete_trans (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