문제

Snippet of original table:

CREATE TABLE [dbo].[Batch](
    [CustomerDepositMade] [money] NOT NULL 
         CONSTRAINT [DF_Batch_CustomerDepositMade]  DEFAULT (0)

Snippet of copied table:

CREATE TABLE [dbo].[Batch](
    [CustomerDepositMade] [money] NOT NULL,

Code for copy database:

        Server server = new Server(SourceSQLServer);
        Database database = server.Databases[SourceDatabase];

        Transfer transfer = new Transfer(database);
        transfer.CopyAllObjects = true;
        transfer.CopySchema = true;
        transfer.CopyData = false;

        transfer.DropDestinationObjectsFirst = true;

        transfer.DestinationServer = DestinationSQLServer;
        transfer.CreateTargetDatabase = true;

        Database ddatabase = new Database(server, DestinationDatabase);
        ddatabase.Create();
        transfer.DestinationDatabase = DestinationDatabase;
        transfer.Options.IncludeIfNotExists = true;
        transfer.TransferData();
도움이 되었습니까?

해결책

The Transfer.Options property may provide an answer. In particular, looking at the documentation, setting the DriDefaults property and, more generally, the DriAll property to true may help.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top