why can''t sqlExpress attach a database that I have detached then renamed?

  • hiya,
     
    I wanted to swap one database with a similar database in sqlExpress.
     
    So, I:
     
    1) copied over datbaseOne.mdf into a backup DIR.
    2) detached databaseOne.
     
    I then tried to attach databaseOne.dbf from the backup DIR
     
    error: <<cannot attach a database with the same name as an existing database>
     
    fine,  I rename the database that I want to attach as "databaseOneXX.dbf "
     
    I then try to attach, same crap error. I refresh vis MSSQL management studio, close it, re-open, and try to attach again, same crap error...WHY?
     
     
    If there's an easier cheap and nasty way to do this, I'd love to know :-0
     
    cheers,
     
    yogi
  • This was removed by the editor as SPAM

  • You need to actually change the Logical name of the database, not the physical data file name.

    Are you attaching the db using a GUI (Management Studio, or the Express GUI), or are you using sqlcmd (T-SQL)?


    Enjoy!

    A Brown

    Manage all of your backups in one simple job using this script.

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

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