<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0" xml:base="http://www.red-gate.com/MessageBoard/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Red Gate forums: SQL Comparison SDK Previous Versions</title>
 <link>http://www.red-gate.com/MessageBoard/</link>
 <description>Product Support and Discussion</description>
 <language>en</language>
 <copyright>Copyright Red Gate Software Ltd</copyright>
 <managingEditor>internalsupport@red-gate.com</managingEditor>
 <webMaster>internalsupport@red-gate.com</webMaster>
 <docs>http://blogs.law.harvard.edu/tech/rss</docs>
 <ttl>60</ttl>
 <lastBuildDate>Wed, 19 Jun 2013 19:28:06 GMT</lastBuildDate>
 <pubDate>Wed, 19 Jun 2013 19:28:06 GMT</pubDate>
 <image>
  <url>http://www.red-gate.com/messageboard/templates/subRed/images/logo_phpBB.gif</url>
  <title>Red Gate forums: SQL Comparison SDK Previous Versions</title>
  <link>http://www.red-gate.com/MessageBoard/</link>
 </image>
 <item>
  <title>RE: The &amp;quot;Duplicate object name has been found&amp;quot; C# Exception</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=62623#62623</link>
  <description>Has this bug been resolved in the latest version of SQL Prompt?</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=13717</comments>
  <dc:creator>ghendric</dc:creator>
  <pubDate>Tue, 18 Jun 2013 14:37:08 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=62623#62623</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59218#59218</link>
  <description>Glad that's sorted. Post back or email us if you need anything further!</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Fri, 30 Nov 2012 11:50:11 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59218#59218</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59217#59217</link>
  <description>Ok, thanks. This works for me.</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>njansen</dc:creator>
  <pubDate>Fri, 30 Nov 2012 11:48:23 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59217#59217</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59216#59216</link>
  <description>Thanks for supplying the snapshot. It does look like dependencies- I loaded up your snapshot in your sample code and found that it was also scripting some tables.
&lt;br /&gt;

&lt;br /&gt;
Amending the options as I described earlier stops that - here's the correct line (notice it's the options at the point of building your 'work' that's important as the dependencies are included (or not) during the sync phase usually)
&lt;br /&gt;

&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Calculate the work to do using sensible default options 
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // The script is to be run on production so the runOnTwo parameter is true 
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; work.BuildFromDifferences&amp;#40;stagingVsProduction, Options.IgnoreFileGroups | Options.IgnoreFillFactor | Options.IgnoreUserProperties | Options.IgnoreWhiteSpace | Options.IgnoreWithElementOrder | Options.IgnoreDatabaseAndServerName | Options.DecryptPost2kEncryptedObjects, true&amp;#41;;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Fri, 30 Nov 2012 11:31:33 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59216#59216</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59198#59198</link>
  <description>Sure- otherwise, it's probably just down to the objects that function relates to so a simple repro should also suffice track it down.</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Thu, 29 Nov 2012 15:21:40 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59198#59198</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59197#59197</link>
  <description>I can't provide the snapshot in the current shape. I'll have to strip the database and make a new snapshot.</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>njansen</dc:creator>
  <pubDate>Thu, 29 Nov 2012 15:18:09 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59197#59197</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59195#59195</link>
  <description>OK, I tried your code here with defaults and a couple of functions and it only scripts the function that matches.
&lt;br /&gt;

&lt;br /&gt;
Is it possible for you to supply your snapshot as the problem you're seeing is likely to be rather dependent on the specifics of your DB. If so, please mail it to &lt;a href=&quot;mailto:support@red-gate.com&quot;&gt;support@red-gate.com&lt;/a&gt; quoting F0067161 in the subject line.</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Thu, 29 Nov 2012 13:51:49 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59195#59195</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59194#59194</link>
  <description>Options.IgnoreDatabaseNames doesn't exists, so i tried IgnoreDatabaseName, but the option is obsolete, so i used the recomended option IgnoreDatabaseAndServerName.
&lt;br /&gt;
I still receive a script with objects i don't want.
&lt;br /&gt;

&lt;br /&gt;
for example, the script want's to drop constraints on tables;
&lt;br /&gt;
ALTER TABLE [dbo].[AGMG] DROP CONSTRAINT [PK_AGMG]
&lt;br /&gt;

&lt;br /&gt;
As you can see in the code fragment, I only select functions which start with a specific name.</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>njansen</dc:creator>
  <pubDate>Thu, 29 Nov 2012 13:03:05 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59194#59194</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59193#59193</link>
  <description>IncludeDependencies is a default option. To turn it off you need to explicitly select all other defaults asides from that; so replace:
&lt;br /&gt;

&lt;br /&gt;
options.default
&lt;br /&gt;

&lt;br /&gt;
with
&lt;br /&gt;

&lt;br /&gt;
options.IgnoreFileGroups | options.IgnoreFillFactor | options.IgnoreUserProperties | options.IgnoreWhiteSpace | options.IgnoreWithElementOrder | options.IgnoreDatabaseNames |  options.DecryptPost2kEncryptedObjects</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Thu, 29 Nov 2012 12:08:48 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59193#59193</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59192#59192</link>
  <description>I can only select Options.IgnoreSynonymDependencies, but that doesn't work. The other option about dependecies is IncludeDependencies, there's no IgnoreDependencies option.
&lt;br /&gt;

&lt;br /&gt;
I'm trying to synchronise a list of table valued functions.
&lt;br /&gt;

&lt;br /&gt;
Here's a code fragment (in C#);
&lt;br /&gt;

&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;using System;
&lt;br /&gt;
using System.Collections.Generic;
&lt;br /&gt;
using System.Linq;
&lt;br /&gt;
using System.Text;
&lt;br /&gt;
using Microsoft.SqlServer.Dts.Runtime;
&lt;br /&gt;
using System.IO;
&lt;br /&gt;
using System.Data;
&lt;br /&gt;
using System.Data.SqlClient;
&lt;br /&gt;
using System.Reflection;
&lt;br /&gt;
using RedGate.SQLCompare.Engine;
&lt;br /&gt;
using RedGate.Shared.SQL.ExecutionBlock;
&lt;br /&gt;

&lt;br /&gt;
namespace Config.DatabaseUpdate
&lt;br /&gt;
&amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; class OltpFunctions
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp;public static bool SyncOltpFunctionsToFile&amp;#40;string TargetCatalog, string TargetServer, int logType&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool res = true;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string snapshotFile = Config.DataManager.ApplicationScriptPath&amp;#40;&amp;#41; + &amp;quot;\\SnapshotProqOltp.snp&amp;quot;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using &amp;#40;Database stagingDB = new Database&amp;#40;&amp;#41;,productionDB = new Database&amp;#40;&amp;#41;&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ConnectionProperties targetConnectionProperties = new ConnectionProperties&amp;#40;TargetServer, TargetCatalog&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Connect to the two databases and read the schema
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;&amp;quot;Loading snapshot file&amp;quot;, 2&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stagingDB.LoadFromDisk&amp;#40;snapshotFile&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch &amp;#40;SqlException e&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;e.Message, logType&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; res = false;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return res;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;&amp;quot;Registering database &amp;quot; + targetConnectionProperties.DatabaseName, 2&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; productionDB.Register&amp;#40;targetConnectionProperties, Options.Default&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch &amp;#40;SqlException e&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;e.Message, logType&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; res = false;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return res;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Compare snapshot to production. Comparing in this order makes production the second database
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Differences stagingVsProduction = stagingDB.CompareWith&amp;#40;productionDB, Options.IgnoreSynonymDependencies&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Select the differences to include in the synchronization. In this case, we're using all differences.
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach &amp;#40;Difference difference in stagingVsProduction&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; difference.Selected = false;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Only select functions
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;#40;difference.DatabaseObjectType == ObjectType.Function&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // only fix differences or create new objects in the target database
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;#40;&amp;#40;difference.Type == DifferenceType.Different&amp;#41; || &amp;#40;difference.Type == DifferenceType.OnlyIn1&amp;#41;&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Only select objects which start with Dim, Fact, Etl or Sec
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;#40;&amp;#40;difference.Name.ToUpper&amp;#40;&amp;#41;.StartsWith&amp;#40;&amp;quot;&amp;#91;DBO&amp;#93;.&amp;#91;DIM&amp;quot;&amp;#41;&amp;#41; || &amp;#40;difference.Name.ToUpper&amp;#40;&amp;#41;.StartsWith&amp;#40;&amp;quot;&amp;#91;DBO&amp;#93;.&amp;#91;FACT&amp;quot;&amp;#41;&amp;#41; || &amp;#40;difference.Name.ToUpper&amp;#40;&amp;#41;.StartsWith&amp;#40;&amp;quot;&amp;#91;DBO&amp;#93;.&amp;#91;ETL&amp;quot;&amp;#41;&amp;#41; || &amp;#40;difference.Name.ToUpper&amp;#40;&amp;#41;.StartsWith&amp;#40;&amp;quot;&amp;#91;DBO&amp;#93;.&amp;#91;SEC&amp;quot;&amp;#41;&amp;#41;&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;string.Format&amp;#40;&amp;quot;Selected objectname&amp;#58; &amp;#123;0&amp;#125;&amp;quot;, difference.Name&amp;#41;, 6&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; difference.Selected = true;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Work work = new Work&amp;#40;&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Calculate the work to do using sensible default options
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // The script is to be run on production so the runOnTwo parameter is true
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; work.BuildFromDifferences&amp;#40;stagingVsProduction, Options.Default, true&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // We can now access the messages and warnings
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;&amp;quot;Messages&amp;#58;&amp;quot;, logType&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach &amp;#40;Message message in work.Messages&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;message.Text, logType&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;&amp;quot;Warnings&amp;#58;&amp;quot;, logType&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach &amp;#40;Message message in work.Warnings&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;message.Text, logType&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Disposing the execution block when it's not needed any more is important to ensure
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // that all the temporary files are cleaned up
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using &amp;#40;ExecutionBlock block = work.ExecutionBlock&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Display the SQL used to synchronize
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;&amp;quot;SQL to synchronize&amp;#58;&amp;quot;, logType&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;block.GetString&amp;#40;&amp;#41;, logType&amp;#41;;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Finally, use a BlockExecutor to run the SQL against the WidgetProduction database
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //BlockExecutor executor = new BlockExecutor&amp;#40;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //executor.ExecuteBlock&amp;#40;block, targetConnectionProperties.ServerName, targetConnectionProperties.DatabaseName&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Write the sql block to a file.
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataManager.FileWriter&amp;#40;block.GetString&amp;#40;&amp;#41;, @&amp;quot;D&amp;#58;\Temp\SqlToSync.sql&amp;quot;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch &amp;#40;SqlException e&amp;#41;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.Log&amp;#40;e.Message, 2&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; res = false;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return res;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return res;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;#125;
&lt;br /&gt;
&amp;#125;
&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>njansen</dc:creator>
  <pubDate>Thu, 29 Nov 2012 11:52:02 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59192#59192</guid>
 </item>
 <item>
  <title>RE: Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59181#59181</link>
  <description>The last time I tried this it seemed to work okay. One possibility is if the objects being included are dependencies of others - is this the case? If so, you may need to set the option to not include dependencies. 
&lt;br /&gt;

&lt;br /&gt;
Failing that, can you post back a code sample of how you've got it set up and details of the assembly versions you're referencing so I can try it out here?</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Wed, 28 Nov 2012 16:40:42 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59181#59181</guid>
 </item>
 <item>
  <title>Difference list doesn't work</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=59142#59142</link>
  <description>I'm building a tool to sync a specific list of objects
&lt;br /&gt;
For each object i want to sync i'll set the Difference.Selected property to true, for all other objects i don't want to sync, i'll set the Difference.Selected property to false.
&lt;br /&gt;

&lt;br /&gt;
After that, i'll call the Work.BuildFromDifferences method;
&lt;br /&gt;
Work.BuildFromDifferences(Differences, Options.Default, true);
&lt;br /&gt;

&lt;br /&gt;
Why do i see objects where the Difference.Selected prop is set the false?</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=16175</comments>
  <dc:creator>njansen</dc:creator>
  <pubDate>Tue, 27 Nov 2012 15:07:23 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=59142#59142</guid>
 </item>
 <item>
  <title>Skip compare, migrate all rows</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=55328#55328</link>
  <description>I would like to migrate data into an empty database with the same schema as the source.  Since I know there will never be data in the destination, is there a way to skip the CompareDatabases() call and force the GetMigrationSQL() step to generate INSERT statements for all rows in the source database?  
&lt;br /&gt;

&lt;br /&gt;
I ask because the CompareDatabases() call can take a long time on larger databases (20GB+), which seems unnecessary given that we know the destination is empty and there's nothing to compare to.
&lt;br /&gt;

&lt;br /&gt;
Thanks!
&lt;br /&gt;
Brian</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=15120</comments>
  <dc:creator>schammer</dc:creator>
  <pubDate>Thu, 26 Apr 2012 16:37:28 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=55328#55328</guid>
 </item>
 <item>
  <title>RE: Latest version of assemblies</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=54141#54141</link>
  <description>The latest v10 Comparison SDK is now available &lt;a href=&quot;http://downloads.red-gate.com/checkforupdates/SQLComparisonSDK/SQLComparisonSDK_10.0.0.81.exe&quot; target=&quot;_blank&quot; class=&quot;postlink&quot;&gt;here&lt;/a&gt;</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=14579</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Thu, 01 Mar 2012 12:17:21 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=54141#54141</guid>
 </item>
 <item>
  <title>RE: Order of tables in synchronization script (data compare)</title>
  <link>http://www.red-gate.com/MessageBoard/viewtopic.php?p=54132#54132</link>
  <description>Thanks for your post - you may have trouble unfortunately. There's no easy way to control the ordering in the way you suggest, as our sync scripts are designed to work by disabling all FK's first, inserting/updating/deleting as appropriate, then re-enabling again. 
&lt;br /&gt;

&lt;br /&gt;
If you can work out a correct order to do things that satisfies the keys then potentially you could work with one table at a time; but it's likely to get a bit messy...</description>
  <category>SQL Comparison SDK Previous Versions</category>
  <comments>http://www.red-gate.com/MessageBoard/posting.php?mode=reply&amp;t=14823</comments>
  <dc:creator>james.billings</dc:creator>
  <pubDate>Wed, 29 Feb 2012 16:05:25 GMT</pubDate>
  <guid isPermaLink="true">http://www.red-gate.com/MessageBoard/viewtopic.php?p=54132#54132</guid>
 </item>
</channel>
</rss>
