Changing logical & physical filenames

  • Hi everyone, can someone help me with this? Thanks in advance.

    1. How do I change a filename from x.mdf to y.mdf?

    2. How do I change the filename used in SQL Server from X to Y?

  • To change the physical name, detach the database and rename. Then attach the database.

    As far as I know you cannot change the logical name of a database.

    Wilson

  • Here's a link with a solution to your problem,

    http://www.ssw.com.au/ssw/kb/KB.aspx?KBID=Q365270

     

     

  • From BOL:

     

    ALTER DATABASE database_name

    MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

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

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