Welcome to Sign in | Help

Re: cum creez un folder in T-SQL (SQLServer 2000)

  •  06-21-2007, 1:52 PM

    Re: cum creez un folder in T-SQL (SQLServer 2000)

    eu am incercat sa fac ceva inspirat dintr-un alt exemplu....ceva de genul

    -- pentru serverele din lan se va folosi mapare la copiere

     SET @tmpServer='master..xp_cmdshell'

     SET @tmpSQL='NET USE x: \\' + @SysServerName + '\' + @ParentBackupDrive --+ SUBSTRING(@ParentBackupDrive,1,1) + '$'
     EXEC @tmpServer @tmpSQL

     SET @tmpSQL='COPY x:\' + ' ' + @PathToMove + + @PackFileName -- + @ParentBackupPath + '\' + @PackFileName
     EXEC @tmpServer @tmpSQL

    if @@error = 0
    begin
     SET @tmpSQL='DEL x:\' + @ParentBackupPath + '\' + @PackFileName
     EXEC @tmpServer @tmpSQL 
     EXEC @tmpServer 'NET USE x: /DELETE'
    end
    else
    begin
     EXEC @tmpServer 'NET USE x: /DELETE'
    end

    doar ca se impotmoleste la copy x:\

    :(

    alex.

    P.S. sunt sigur ca merge facut tot din procedura doar ca nu-mi dau seama ce nu fac bine.........

View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems