Using publishing to transfer MS SQL data

Source: Internet
Author: User

Recently, the site moved from the domestic site to the Lunarpage, the program transfer is relatively simple, using cuteftp upload on it. But database transfers have always been a tricky problem. This article describes the method of database transfer.

The easiest way to transfer a database is by using DTS, but the Lunarpages database does not support remote database links, so DTS is not available, so you have to use publishing to transfer the data.

The specific steps are as follows:

Step1. Run SqlPubWiz.exe

Publishing a plug-in similar to MS SQL, you can go to the

Http://www.microsoft.com/downloads/details.aspx?FamilyId=56E5B1C5-BF17-42E0-A410-371A838E570A

Download, after the operation can be found under the tools

Step2 Run, the Run wizard appears and the local database is found

Step3. Options to generate the type, the system will automatically detect the available content, the general choice of "table" "Stored Procedures" and "view" for users do not allow the system to generate

Click Next to complete.

Change database owner

Here is the core, very important, otherwise it will not succeed.

When we use the website, we usually use the SP to our account, for example, my original database is called "bf4190_"

When the website provider gave me an account of bf419, the system generated data tables are as follows

As you can see, some tables have prefix bf419, some have prefix dbo (db Oh, database owner), which is very different. Because the script is slightly different when we set up the table.

Writing a:

CREATE TABLE [dbo].  [Ads] (

[ID] [int] IDENTITY (1,1) not NULL,

[Name] [nvarchar] (m) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[img] [nvarchar] (m) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

}

Writing two:

CREATE TABLE [Ads] (

[ID] [int] IDENTITY (1,1) not NULL,

[Name] [nvarchar] (m) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[img] [nvarchar] (m) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

}

For the first, the resulting table is dbo.ads, and the second table is bf419.ads, because your bf419 is actually dbo, so the system can run.

However, when you transfer the database to a new service provider, if your account is called XXXX, the above set up Bf419.ads error, and with Dbo.ads is completely no problem.

Usually the new and old service providers to the user's user name is not the same, so we need to change the owner of the database.



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.