开发者

Microsoft.SqlServer.Management.Smo.Transfer() losing contraints

开发者 https://www.devze.com 2023-01-03 16:50 出处:网络
I\'m trying to copy SQL database from one server to another. Ple开发者_开发知识库ase tell me how to use Transfer() method without loosing constraints in the target database.

I'm trying to copy SQL database from one server to another.

Ple开发者_开发知识库ase tell me how to use Transfer() method without loosing constraints in the target database.

I've tried different parameters including

 CopySchema = true;     // and 
 CopyAllSchemas = true; //and even 
 CopyAllObjects = true;

and still this damn thing is losing all the constraints.

Help me, pls!


Ok...

 transfer.Options.DriAll = true;

helped. But now It's leaving all triggers behind


In options some flags for select the object to copy

  transfer.Options.Triggers = true;
  transfer.Options.Indexes = true;
  transfer.Options.Statistics = true;
0

精彩评论

暂无评论...
验证码 换一张
取 消