Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 backup of the entire test database

Author  Topic 

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2010-08-05 : 08:13:53
I want to have backup of entire test database to my local machine
how do i do that?I have sql server 2008 developer edition.The test database is on a remote server on which I have access to only my test database.

Things I tried and did not work
1)I tried to backup the test database onto a shared drive of the remote server which i dont have access to from my local computer.

2)Will scripting the entire database to a file and running the file on my local machine create the entire table and data on my local machine

Please advise

thanks

Kristen
Test

22859 Posts

Posted - 2010-08-05 : 08:39:11
Backup (then Download and Restore locally) would be best.

Scripting entire database is possible in SQL 2008 (there is an option to also script the Data). If the database is any significant size this will be a tedious route. I would have a worry that it was not identical to the original, in some way (even if just the fragmentation of indexes), such that the testing I did locally was "different" to the original - that concern is overcome by using Restore - you will get an identical copy to the original
Go to Top of Page

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2010-08-05 : 12:17:18
Scripting the database to a file and runing the script on my local machine created all the objects but not the data
I tried to import the data directly from the test database and was succesful for some tables

Can we have the load od the data also in the script

Thanks
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-05 : 12:19:08
You can only generate a script of the data in SQL 2008. For earlier versions you will have to use 3rd party script (there are some here on SQL Team if you do a search)
Go to Top of Page

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2010-08-05 : 12:33:17
how do i generate a script to load data from all the tables in the test to tables I just created in my local server
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-05 : 13:14:44
In SQL 2008 you set SCRIPT DATA to True
Go to Top of Page

ewomack
Starting Member

33 Posts

Posted - 2010-08-05 : 13:26:09
Agree with first response - backing up and restoring locally would be best; you could perform a copy only backup of the data and move the file (how large is the DB?) to your machine and perform a copy only restore. This will save you from scripting.

Ed Womack
www.getmilked.com
Go to Top of Page
   

- Advertisement -