Home Forums SQL Server 7,2000 General Rename a text file, move it, using a stored procedure RE: Rename a text file, move it, using a stored procedure

  • the move command really just copied the file with the given name, and then deletes the previous file. there is no need to move it with the same name, and then rename it.

    just use :

    EXEC master..xp_cmdshell 'MOVE C:\ImportData\ImportData.txt C:\ImportData\Finished\' + @NewFileName

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!