SQL Server Import export methods that do not lose primary keys and views

Source: Internet
Author: User
Tags management studio microsoft sql server management studio sql server management sql server management studio

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

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.