Renaming Datafiles

  • Hi All,

    I was asked to rename the data files of a data base.

    I detached it from database and then renamed the data files in the folder.

    After that i attached it to the server.

    I wanna know different methods of doing the same apart from what I did.

    Thanks and Regards,

    Ahmad

    Regards,
    [font="Verdana"]Sqlfrenzy[/font]

  • That's the only way that I am aware it can be done.

    Because of the registration of the data files in the Master, you can just rename files without consequences. It would be handy if you could just rename the file while SQL was stopped and then just have SQL startup and recognize the change. Sadly, that is not how it works.

    Regards, Irish 

  • Thats the only way you can rename the datafiles yet you can rename the logical file name using the alter database command. but the datafiles are physical and thats the only way you have it.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • Thank you all

    Regards,
    [font="Verdana"]Sqlfrenzy[/font]

Viewing 4 posts - 1 through 3 (of 3 total)

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