• F. van 't Hoff (11/29/2011)


    I've tried this script, but it will only work if there are no spaces in the db_name. We have a database named Mediabin Repository and when I run this script, I'll get the following error:

    "Msg 911, Level 16, State 1, Line 1"

    "Could not locate entry in sysdatabases for database 'MediaBin'. No entry found with that name. Make sure that the name is entered correctly."

    What is the correct way to run this script when there are spaces in the database name?

    Because your database name has a space in it, you would need to put it in brackets, [Mediabin Repository].

    I also agree with Kevin. This is not something that should be done on a regular basis. I can see it as a one off due to extraordinary operations, such as a major archiving of data to another database.