How can we help you today? How can we help you today?
ToddY

Activity overview

Latest activity by ToddY

Hi Tianjiao,  Here is the SSIS code that got called:  public void Main() { // TODO: Add your code here             try             {                 string[] dblist = Dts.Variables["$Package::DBList"].Value.ToString().Split(new Char[] { ';' });                 bool nope = false;                                  foreach (string db in dblist)                 {                     StringBuilder sb = new StringBuilder();                     sb.Append(" /server1:");                     sb.Append(Dts.Variables["$Package::SourceServer"].Value.ToString());                     sb.Append(" /username1:");                     sb.Append(Dts.Variables["$Package::SourceServerUserName"].Value.ToString());                     sb.Append(" /password1:");                     sb.Append(Dts.Variables["$Package::SourceServerPassword"].Value.ToString());                     sb.Append(" /database1:");                     sb.Append(db);                     sb.Append(" /server2:");                     sb.Append(Dts.Variables["$Package::DestinationServer"].Value.ToString());                     sb.Append(" /username2:");                     sb.Append(Dts.Variables["$Package::DestinationServerUserName"].Value.ToString());                     sb.Append(" /password2:");                     sb.Append(Dts.Variables["$Package::DestinationServerPassword"].Value.ToString());                     sb.Append(" /database2:");                     sb.Append(db);                     sb.Append(" /force /synchronize /Options:DecryptPost2KEncryptedObjects,IgnoreFillFactor,IgnoreWhiteSpace,IgnoreFileGroups,IgnoreUserProperties,IgnoreWithElementOrder,IgnoreDatabaseAndServerName ");                     // bring in sync flags                     sb.Append(Dts.Variables["$Package::SyncingFlags"].Value.ToString());                     sb.Append(" /logLevel:Verbose");                     sb.Append(@ /Exclude:user /Exclude:role /Exclude:ddltrigger /Exclude:partitionscheme /Exclude:partitionfunction);                     sb.Append(" /Out:" + Dts.Variables["$Package::LoggingDirectory"].Value.ToString() + Dts.Variables["$Package::DestinationServer"].Value.ToString().Replace("-", "").Replace("\\", "").Replace(",","").Replace(".","") + db + "_output.txt");                     string msg = "...syncing - schemas & UDTs - database - " + db;                     Dts.Events.FireInformation(1, "output", msg, "", 0, ref nope);                     //string ex = @"""C:\Program Files (x86)\Red Gate\SQL Compare 13\sqlcompare.exe""";                     string ex = Dts.Variables["$Package::RedgateFilePath"].Value.ToString();                     ProcessStartInfo startInfo = new ProcessStartInfo();                     startInfo.CreateNoWindow = true;                     startInfo.UseShellExecute = false;                     startInfo.FileName = ex;                     startInfo.WindowStyle = ProcessWindowStyle.Hidden;                     startInfo.Arguments = sb.ToString();                     Process process = new Process();                     process.StartInfo = startInfo;                     process.Start();                     process.WaitForExit();                                      }                 Dts.TaskResult = (int)ScriptResults.Success;             }             catch (Exception ex)             {                 MessageBox.Show(ex.ToString());                 Dts.TaskResult = (int)ScriptResults.Failure;             } } As you can see, after passing the arguments with "  startInfo.Arguments = sb.ToString();", the process.Start() will start to compare and sync. It does sync table and synonym very well, but it excludes "view", even if I explicitly includes view. I guess somewhere in the UI has an exclude settings? But I don't know where the include/exclude setting are from the UI.  Thanks   / comments
Hi Tianjiao, Here is the SSIS code that got called: public void Main() { // TODO: Add your code here            try            {                string[] dblist = Dts.Variables["$Package::DBList"...
0 votes