Renaming logical files

  • Hi,

    Having trouble renaming logical db files using the Microsoft described way;

    ALTER DATABASE dbname

    MODIFY FILE(NAME=DB_Data, NEWNAME=DBTEST_Data)

    QA does not recognise 'NEWNAME' as an option but it's the Sql2K Manual !?!?

    ALTER DATABASE database

    { MODIFY FILE < filespec > }

    Expand or collapse text< filespec > ::=

    ( NAME = logical_file_name

        [ , NEWNAME = new_logical_name ]

        [ , FILENAME = 'os_file_name' ]

        [ , SIZE = size ]

        [ , MAXSIZE = { max_size | UNLIMITED } ]

        [ , FILEGROWTH = growth_increment ] )

     
    Can anyone shed any light on this ? or describe an alternate way I can get it to work ?
     
    Many thanks in advance.
     
  • Just did this via QA

    ALTER DATABASE testtheory

    MODIFY FILE(NAME='testtheory_Log', NEWNAME='testtheory2k_Log')



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • works for me too (with and without the single quotes for the names)

    ALTER DATABASE MetaData

    MODIFY FILE(NAME=MetaData_Data, NEWNAME=MetaData)

    GO

    ALTER DATABASE MetaData

    MODIFY FILE(NAME='MetaData', NEWNAME='MetaData_Data')

    What is the exact error description you are seeing?

  • Hi,

    Thanks for the replies. However I seem to have omitted that I was trying it on a SqlServer 7 !, as it too works ok for me on Sql2k.

    Is this option a new feature for Sql2k ?, if so, how was it managed prior to this version ?

    Thanks in advance.

    j

  • yes...the NEWNAME option was added in SQL 2000 and isn't available in SQL 7.0...the only workaround (AFAIK) was modifying the system tables directly ()

    any specific reason for changing the logical file name?? they are applicable only at a database level so it shouldn't matter much what the logical file names are...

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

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