Changing Logical File Names

  • I have inherited a database with inconsistent logical file names. sp_helpdb returns the following (note 93's v. 99's)...

    name filename

    db_referral_1_93_Data F:\sqldata\db_referral_1_99.MDF

    db_referral_1_93_Log F:\sqllogs\db_referral_1_99.LDF

    When I backup, delete, create (with consistent names and filenames) and restore the backup to the new database, the inconsistent logical file names return. Any suggestions appreciated.

    Thanks,

    Dave

  • This script handles this:

    http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=764

    Andy

  • How about this:

    ALTER DATABASE database MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...)

    For more information search for ALTER DATABASE in BOL.

  • I appreciate the suggestions offered in response to my question.

    Thanks,

    Dave

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

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