Renaming a file with Cmdshell

  • Your script should work without any problem but....

    You are trying to rename .ldf file which is data base log file... if I am not mistaken...

    You can rename the file while db is active... so you have to kill all the users from the db and detach it using sp_detachdb procedure then rename it...

    I don't understand why you want to rename .ldf file...

    MohammedU
    Microsoft SQL Server MVP

Viewing post 1 (of 2 total)

You must be logged in to reply to this topic. Login to reply