How to import data from SQL Server 2008 in a SQL Server 2005 database _mssql2005

Source: Internet
Author: User
Tags create database

1. generate a for 2005 version of the database script

Manger Studio, 2008
--Open "Object Explorer" (no words pressed F8), connect to your instance
--right key to go to 2005 of the Library
-Mission
--Generating scripts
--In the "Select Database" of the Script wizard, make sure that you select the library that you want to go to 2005
--"Scripting all objects in the selected database" 5
--In the next "Choose script Options", set "script to create DATABASE" to true, locate the "Script for server version" item, and select "SQL Server2005"
--other options set as needed
--Finally, save the script to a. SQL script file

2. Create the target database in 2005

In Query Analyzer (or 2008 of Manger Studio opens the script file), connect to SQL Server 2005 and execute the script generated above. To create a new database

3. To Guide data from 2008 to the

Open Enterprise Manager for SQL Server 2005
--Right-click the database to which you want to import data
-Mission
--Import data
--In the "Select data source" step of the SQL Server Import and Export Wizard, determine which database to export is selected
--In the "Select data Source" step, connect to 2005 and select the source database
--In Select source table and Source view, select all tables
--finally completed

Export data from the SQL2008 database to another database, and if there is a self-added primary key in the database, an error will be reported when exporting

Resolve: In the database import "Select source table and Source view"-> Click the corresponding table after the "Edit Map" button-> Check "Enable identity column Insert"-> import can.

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.