Change Logical File Names of Database

  • Hi Every one,

    I need to change logical file names of the database. The database contins 5 file group including log file, 5 logical and physical file names. My solution seems little longer and I am looking for any suggestions and thoughts on this problem. The database size is 14GB (kind of small)

    My Solution:

    Step1: Create a new database with new required logical file names and file groups.

    Step2: Write a T-SQL script that creates objects (Tables, stored procedure, indexes script) and populate data into the tables / use enterprise manager's import data option. But Step2 is very complicated to populate data after considering foreign key constraints (Table Hierarchy).

    I really appreciate your time and insight on the issue.

    Thanks,

    Bhushan

     

     

     

  • http://qa.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=250647

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • You can also use this:

    alter database db_name modify file (Name = old_data_name, NewName = New_Data_Name)

    alter database db_name modify file (Name = old_log_name, NewName = New_Log_Name)

    Hope this helps

  • Thank you very much John and Gary....It worked and saved my time.

    Bhushan

     

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

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