Home Forums SQL Server 7,2000 General Copy and rename a file using stored procedure in SQL server 2005 RE: Copy and rename a file using stored procedure in SQL server 2005

  • You CAN have file names with spaces (although, I prefer not to). And, you can easily run commands on those file names by enclosing the filename in double quotes... like this...

    EXEC master..xp_cmdshell 'RENAME "C:\Webservices\datasource\TradeDetail04-02-08 00_00_00 .txt" TradeDetail.txt'

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)