Recently I work in the company. Sometimes I need to copy the database on the company's server to my computer and bring it back home. When I feel good, I need to add a small class. Many of my friends may not, or are unfamiliar with how to quickly migrate databases. Method 1: script method if your database is updated every day and there are not many changes today, you can make all your changes
Recently I work in the company. Sometimes I need to copy the database on the company's server to my computer and bring it back home. When I feel good, I need to add a small class. Many of my friends may not, or are unfamiliar with how to quickly migrate databases. Method 1: script method if your database is updated every day and there are not many changes today, you can make all your changes
Recently I work in the company. Sometimes I need to copy the database on the company's server to my computer and bring it back home. When I feel good, I need to add a small class. Many of my friends may not, or are unfamiliar with how to quickly migrate databases.
Method 1: script
If your database is updated every day and the changes are not significant today, you can make all your changes into scripts and put them in the local database for execution. In this case, the company generally writes the same database publishing script.
Method 2: Backup and reduction
Select the database to be transferred from the database on the server, right-click, select all tasks-> back up the database; copy the backup to the local machine, select the local existing database (no need to create a new database) right click → task → Restore database.
Find the. bak file you copied. It is worth noting that sometimes there is an error: two databases are not one database. In this case, you can overwrite the existing database with the options.
Method 3: If you only copy the database on the server to the local database, right-click the database and export the data to the corresponding local database according to the wizard (provided that the local database has no data, if there is data, it will not overwrite and there will be two identical records), and after it is done, it will get the functions and stored procedures in place, so this method is not recommended.
Method 4: Additional Method
First, separate the database connection, copy the database file (. mdf file) to the local device, right-click it, and append it to find the. mdf file.