SQL Server 2005 – How to Make a Copy from a Mirror Copy

mirroringsql serversql-server-2005

I have a SQL mirror database in Microsoft SQL Server 2005. I would like to get a copy of it as a new database so I have the ability to read, write, and backup the database.

I cannot break the mirror and ALTER it to become a live database. This is a business requirement that we always have a copy on the other server.

I need a method to pull the data and all other parts of the database (triggers, stored procedures, etc) out of it into another database without breaking the mirror. I have tried SQL Server backups, which do not work on mirrors or snapshots of mirrors, and running through the copy database wizard which also did not work.

Is there any way to get a copy from the mirror database?

Best Answer

You might try something like the following, replacing the db and table names ...

into desired_copy_db_name..tablename(col1, col2, ...)
select col1, col2, ...
from live_mirror_db_name..tablename

This would be after the structure of the copy_db had been created.