cmdolcet
asked on
How to backup two databases and over write another
I have my production Database that I would like to backup and then restore the data to a "sandbox" database. The problem is that I the production database is not the same name as the sandbox database.
How would I solve this issue and be able to backup the production data and rename it to the sandbox database.
Thanks in advance.
How would I solve this issue and be able to backup the production data and rename it to the sandbox database.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
but you need to make sure that you do not use the database name itself inside of any of the objects (SPs, UDFs, Views). So if there is something like "SELECT ... FROM ProductionDatabase.dbo.Tab leName" then of course you need to remove "Productiondatabase." from all these code lines as it is normally never needed to explicitly add the database name. This should be removed permanently, not only for the sandbox.
I recommend to use a tool like Redgate Search (free to download and install) which is able to search through all existing objects.
Cheers,
Christian
but you need to make sure that you do not use the database name itself inside of any of the objects (SPs, UDFs, Views). So if there is something like "SELECT ... FROM ProductionDatabase.dbo.Tab
I recommend to use a tool like Redgate Search (free to download and install) which is able to search through all existing objects.
Cheers,
Christian
Just restore the sandbox db and in the process point to the backup files from the production one.
Cheers