Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy data and database tables from one database to another

Is there any way that I can copy all the data and database tables (and other objects) from one server table to other server?

To make those things as automated. so that every time we used to get that production data to my local database.

Thanks

like image 863
user300485 Avatar asked Dec 08 '25 12:12

user300485


2 Answers

You could also try out ApexSQL Script, a database migration tool, to script objects and data from one instance and execute it on another instance.

Also you can use ApexSQL Diff and ApexSQL Data Diff, SQL schema and data compare tools, to copy structure and data from a source to destination.

Disclaimer: I work for ApexSQL

Hope this helps

like image 58
Milica Medic Kiralj Avatar answered Dec 11 '25 07:12

Milica Medic Kiralj


You could:

  • backup and restore the database
  • detach and re-attach the database
  • use tools like Red-Gate SQL Compare for structural and Red-Gate SQL Data Compare for data comparison and syncing
  • you could roll your own, using SQL statements and/or SMO (SQL Server Management Objects)
  • probably a gazillion other ways to do this.....
like image 35
marc_s Avatar answered Dec 11 '25 09:12

marc_s



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!