conServer = new Server(new ServerConnection(mySQlCon));
Database db = conServer.Databases[cmbDatabase.Text];
Transfer t = new Transfer(db);
ScriptingOptions scriptOp = new ScriptingOptions();
Server db.DatabaseOptions.RecursiveTriggersEnabled = true;
t.CopyAllObjects = true;
t.DropDestinationObjectsFirst = true;
t.CopySchema = true;
t.CopyData = true;
t.DestinationServer = true;
t.CopyAllDatabaseTriggers = true;
t.Options.Triggers = true;
t.Options.IncludeIfNotExists = true;
StringCollection commands = t.ScriptTransfer();
StringBuilder sb = new StringBuilder();
i'am generate script above way
but the script of stored procedure and table are includeIfNotExists statment but trigger not includeIfNotExist statment why?
IncludeIfNotExist in trigger
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Karthikeyan AnbarasanRank #71 · 25.5K reputationPosted Mar 18, 2011, 6:00 AM EDT
can you post your complete code... im not sure abt this line which class its referring?
Transfer t = new Transfer(db);
jayakrishnan Morayur156 reputationPosted Mar 18, 2011, 7:43 PM EDT
Karthikeyan AnbarasanRank #71 · 25.5K reputationPosted Mar 18, 2011, 8:35 PM EDT