Several ways to migrate SQL Server databases

Source: Internet
Author: User
Tags backup

Recently in the company to work, sometimes need to the company's server database copy to their own computer to take home, when the mood is good when the Canadian small class. Many friends may not be like themselves, or unfamiliar with how to migrate a database quickly.

Method One: Scripting method

If your database is updated every day and your changes are small today, you can script all of your changes to the local database for execution. For the general company to develop write database publishing script.

Method Two: Backup and Restore method

In the server's database, select the database to transfer, press the right mouse button, select All Tasks-> back up the database, copy the backup to local, select the local existing database (no need to create a new) right → task → restore the database.

To find your copy of the. bak file, it is worth reminding that there are times when an error occurs: 2 databases are not a database. This situation point → overwrite the existing database on the option hook.

Method Three: If you just copy the database on the server to the local database, then right → export data, follow the wizard to the corresponding local database (provided that the local database does not have data, if there is data, he will not overwrite 2 identical records), and then get all the functions and stored procedures, So this method is not recommended.

Method IV: Additional method

First detach the database connection, then copy the database file (. mdf file) to local, and then right-click → attach to find the. mdf file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.