SQL Server Import Export
SQL Server Import Export
Tools/Materials
- Import and export data using Microsoft SQL Server Management Studio.
Importing and exporting data directly using Microsoft SQL Server Management Studio loses primary keys, views, and so on.
The correct method of saving is as follows:
First, select the local database that needs to be exported
Right---task---Generate scripts.
Follow the wizard to select the database you want to export next to select scripting options Select the type that you want to build, and note the script that is selected for server version scripting.
Second, create the table on the server.
Copy the generated SQL statement to select the server's database. Right-click New query--Copy the statement generated in the first step to execute.
Third, import data
Select the local database, right-click Tasks, and then click Export Data.
Fill in correctly at the Select destination option.
Next to "Select source table and Source view" Select the desired table and click "Edit Map" check "Enable identity insertion" (Auto-grow column insertion related)
Next to completion.
SQL Server Import export methods that do not lose primary keys and views