Test System maintenance-different versions of SQL data import and export, SQL Import and Export
During the maintenance of the examination system, the examination system (Backup) needs to be built on multiple servers to ensure the smooth conduct of the examination. At this time, the database needs to be migrated back and forth, previously, our commonly used database backup and restoration methods were indeed simple and convenient. However, when different SQL versions were installed on different servers, we had to take a break. Although at that time it was convenient for future operations, we unified the database versions of the servers we used this time, but in the maintenance of the examination system, Mr Mi made me feel the deepest point ----- "think more about everything!" I have carefully studied several SQL data import and export methods to improve my understanding.
I. Use SQLServer Import and Export Tool
Right-click the source database and choose task> export data.
Select the source database and target database respectively
Then follow the default steps to complete the process.
Ii. Generate scripts
Right-click the source database and select task to generate a script.
Select the corresponding database version and Data Option (change to True), and select another option based on your actual requirements.
Run the script file generated by default on the target database.
Iii. Use BCP for Import and Export
BCP is a tool specifically used by SQL for database table-level data backup. You need to learn more about the powerful parameters. The following describes how to import and export BCP data.
The Bcp command can be executed on both the console and sqlserver, and the data export format can be customized, and the data import and export speed is much higher than the above method (big data is relatively obvious ), the understanding of BCP is still one-sided. I hope you will give me more advice.
When we encounter problems, what we lack is to think more than one step. Many times, we feel that we are no different from others, and we think that we are also the people who are diligent in thinking, thinking over and over again is lazy, and we are bound by ourselves. You always think that you are good. Sometimes it is really naive.
I want to do more!
There are still many ways to import and export SQL data of different versions. Please stay tuned to my blog and share more methods.