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