Solved

copying one sql database into different database

Posted on 2011-09-06
2
173 Views
Last Modified: 2012-05-12
Hi,

wanted to create a test company within sql 2008 that has all the same data as our live company.  I created a backup of the live company and actually have the mdf file and also the bak file from backup within the sql management studio.  I went to detach the test company and renamed the file called 850.mdf to 850.mdd.  I then copied the copy of live company mdf into same directory as where the 850.mdd currently is.  I then tried to do an attach of the copy of live company but got errors.  I actually renamed the copy of live data to 850.mdf.  Was this necessary and could i have done a restore of the bak file instead?  The restore actually said that i am trying to restore data that is from a different company structure so forth.  thanks
0
Comment
Question by:dankyle67
2 Comments
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 36491026
Put the live database as it was so that is working. Create a blank new one then restore your backup over the top. When restoring ensure that you point the restore to the blank database location as it will default to the live database.

Lee
0
 

Author Comment

by:dankyle67
ID: 36495599
Found out that key is you have to select option to restore over existing database which i didnt do first time.  Worked after doing this, thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now