SQL Server A libraries and B libraries on the same servers

Source: Internet
Author: User

Method 1:

Insert into A.dbo.users (FIELD1,FIELD2,FIELD3) SELECT * FROM B.dbo.users

Note: The same server, A and B are different databases, such as the table is automatically marked, you can first cancel the automatic indicator, and then execute.

Method 2:

A. Copying the table Dbo.users in database a to database B requires the first step: right-click Edit Table Script->create to the new Query editing window, copy the content!

B. in the query, select database B, right-select new query, and paste in the copied code. Remember to remove the line code from use B and select Execute. ----"Table structure.

Within database B, a table has been added Dbo.users but without data, you need to go through the steps: (1) Import the data in database B, right-click Tasks, and import the tables in. (2) Note: Select source table, click Edit Map, select Enable identity insertion, OK, next

The import succeeds.

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.