none
the action can't be completed because the file is open in sql server(SQLEXPRESS)

    Question

  • When i try to copy SQL database from its original location to another location elsewhere in my computer i get this error message

    " the action can't be completed because the file is open in sql server(SQLEXPRESS) "

    But i have already closed the SQL server by clicking the close button at the top right. Restarting the computer helps but i dont want to do that time and again because there are other several programs running which i dont want to interrupt.

    Please help me solve this problem

    Thanking you in advance.

    Wednesday, June 16, 2010 11:01 AM

Answers

  • ALTER

     

    DATABASE dbname SET OFFLINE

    Another option is to backup and restore the database with diff name on diff location

    See WITH MOVE clause in the BOL


    Best Regards, Uri Dimant http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Wednesday, June 16, 2010 11:19 AM

All replies

  • ALTER

     

    DATABASE dbname SET OFFLINE

    Another option is to backup and restore the database with diff name on diff location

    See WITH MOVE clause in the BOL


    Best Regards, Uri Dimant http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Wednesday, June 16, 2010 11:19 AM
  • ALTER

     

    DATABASE dbname SET OFFLINE

    Another option is to backup and restore the database with diff name on diff location

    See WITH MOVE clause in the BOL


    Best Regards, Uri Dimant http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Wednesday, June 16, 2010 11:20 AM