Copy Database Wizard fails on creation of view into another not-yet-copied database

Posted by user22037 on Server Fault See other posts from Server Fault or by user22037
Published on 2010-01-05T22:27:35Z Indexed on 2011/02/07 23:27 UTC
Read the original article Hit count: 239

Filed under:

Update - I found that doing a manual detach/reattach using MSDN article "How to: Move a Database Using Detach and Attach (Transact-SQL)" got around this issue. I'll just be creating a script to dettach and reattach but do the file copies manually. Any info on how to overcome the problems with the wizard would be helpful in the future.

I am in the process of moving around 20 databases from our current server to a new one. When performing the copies however I have found that some databases can not copy if they have views into other databases that have not yet been copied to the target system.

The log file generated says "failed with the following error: "Invalid object name" in reference to the database in the view. If I first copy just the database referenced in the view and then in a separate step copy the database over containing the view it is successful. However some other database have views into each other so can't just adjust the order in which the copy occurs.

Is there any way to ignore this error and just allow everything to copy?

© Server Fault or respective owner

Related posts about sql-server-2005