Renaming SQL Server Logical File Name

  • I am trying to rename the logical file name of a database.  I am using the script below but receive a message "incorrect syntax near the keyword file"

    Alter Database BD Prueba HYD

    Modify File (name=Apodaca_HYD_Data, NEWNAME=BD_Prueba_HYD_Data)

    I don't see anything wrong with the script, but no matter what I've tried I haven't had any luck.

    Anyone have any ideas?

  • Try this

    Alter Database [BD Prueba HYD]

    Modify File (name=Apodaca_HYD_Data, NEWNAME=BD_Prueba_HYD_Data)

    I doubt it likes the spaces in the database name

    hth

     

    David

Viewing 2 posts - 1 through 2 (of 2 total)

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