<Project DefaultTargets="SchemaCompare" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="SqlSchemaCompareTask" AssemblyName="Microsoft.VisualStudio.TeamSystem.Data.PowerTools.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<PropertyGroup>
<UpdateSql/>
</PropertyGroup>
<Target Name ="SchemaCompare">
<SqlSchemaCompareTask
SourceConnectionString="server=product;user id=sa;password=mypass"
SourceDatabaseName="Northwind"
TargetConnectionString="Data Source=.;Integrated Security=True;Pooling=False"
TargetDatabaseName="Northwind"
OutputPath= "."
OutputFileName = "update.sql"
ForceColumnOrder="true"
IgnoreExtendedProperties="true"
IgnoreStatistics="true"
IgnoreConstraintNames="true"
IgnoreQuotedIdentifiersAndAnsiNullSettings="true"
IgnoreTriggerOrder="true"
IgnoreUsers="true"
IgnoreWhiteSpace="true"
DoNotOutputCommentHeader="true"
NoTransactionalChangeScript="true"
SkipSETStatements="true"
ScriptCollationWhenDifferentFromDefault="true"
/> 
<ReadLinesFromFile File="update.sql">
<Output TaskParameter="Lines" PropertyName="UpdateSql"
</ReadLinesFromFile> 
<!-- NOTE: If update.sql is emtpy, the two databases are same -->
<Message Text="$(UpdateSql)" Condition="'$(UpdateSql)' != ''"
<Error Text="Soure database is different from the target" Condition="'$(UpdateSql)' != ''"
</Target>
</Project>
<Project DefaultTargets="DataCompare" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="SqlDataCompareTask" AssemblyName="Microsoft.VisualStudio.TeamSystem.Data.PowerTools.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<Target Name ="DataCompare">
<SqlDataCompareTask
SourceConnectionString="server=product;user id=sa;password=mypass"
SourceDatabaseName="Northwind"
TargetConnectionString="Data Source=.;Integrated Security=True;Pooling=False"
TargetDatabaseName="Northwind"
OutputPath = "."
OutputFileName = "TestDataCompare.sql"
TrimTrailingSpaces="true"
DisableTriggers="true"
DisableKeys="false"
DoNotOutputCommentHeader="true"
DoNotUseTransactions="true"
</Target>
</Project>