Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSreplcopyscriptfile

  No additional text.


Syntax

-- Name: sp_MSreplcopyscriptfile

-- Descriptions:

-- Parameters: as defined in create statement

-- Returns: 0 - success
--          1 - Otherwise

-- Security: Public procedure invoked via RPC. db_owner check

-- Requires Certificate signature for catalog access

CREATE PROCEDURE sys.sp_MSreplcopyscriptfile
(
    @directory nvarchar(4000),
    @scriptfile nvarchar(4000)
)
as
begin
    set nocount on

    declare @retcode int
    declare @cmd nvarchar(4000)
    
    -- security check
    -- only sysadmin can execute this
    
    if (isnull(is_srvrolemember('sysadmin'),0) = 0)
    begin
        raiserror(14260, 16, -1)
        return (1)
    end

    select @cmd = N'if not exist "' + sys.fn_escapecmdshellsymbolsremovequotes(@directory) collate database_default + '" md "' + sys.fn_escapecmdshellsymbolsremovequotes(@directory) collate database_default + '"'
    exec @retcode = master.dbo.xp_cmdshell @cmd, NO_OUTPUT
    if(@retcode <> 0)
    begin
        raiserror(21330, 16, -1, @cmd)
        return (1)
    end

    -- Copy script to distributor
    select @cmd = N'copy "' + sys.fn_escapecmdshellsymbolsremovequotes(@scriptfile) collate database_default + N'" "' + sys.fn_escapecmdshellsymbolsremovequotes(@directory) collate database_default + N'"'
    exec @retcode = master.dbo.xp_cmdshell @cmd, NO_OUTPUT
    if(@retcode <> 0)
    begin
        raiserror(21331, 16, -1, @cmd)
        return (1)
    end

    return (0)
end

 
Last revision 2008RTM
See also

  sp_MScopyscriptfile (Procedure)
sp_MScopyscriptfile_merge (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