Skip to content

Commit

Permalink
Final 1.2.x version, flagging move to SqlUtils.SqlDataComparison
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebeaton committed Apr 29, 2020
1 parent a26af9a commit 1348128
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 47 deletions.
12 changes: 7 additions & 5 deletions SqlDataComparison.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<authors>Mike Beaton</authors>
<owners>Mike Beaton</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Pure SQL data comparison and reconciliation utility for SQL Server
<description>*** This project has moved to https://www.nuget.org/packages/SqlUtils.SqlDataComparison ***

Pure SQL data comparison and reconciliation utility for SQL Server

Example usage:

Expand Down Expand Up @@ -34,15 +36,15 @@ Supports:
</metadata>
<files>
<!-- new style projects -->
<file src="build\Install.sql" target="contentFiles\any\any\SqlDataComparison" />
<!--file src="build\Install.sql" target="contentFiles\any\any\SqlDataComparison" />
<file src="build\InstallMaster.sql" target="contentFiles\any\any\SqlDataComparison" />
<file src="build\CleanMaster.sql" target="contentFiles\any\any\SqlDataComparison" />
<file src="build\CleanMaster.sql" target="contentFiles\any\any\SqlDataComparison" /-->
<file src="build\README.txt" target="contentFiles\any\any\SqlDataComparison" />

<!-- old style projects -->
<file src="build\Install.sql" target="content\SqlDataComparison" />
<!--file src="build\Install.sql" target="content\SqlDataComparison" />
<file src="build\InstallMaster.sql" target="content\SqlDataComparison" />
<file src="build\CleanMaster.sql" target="content\SqlDataComparison" />
<file src="build\CleanMaster.sql" target="content\SqlDataComparison" /-->
<file src="build\README.txt" target="content\SqlDataComparison" />

<!-- logo -->
Expand Down
2 changes: 1 addition & 1 deletion SqlDataComparison.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>MightyOrm.SqlDataComparison</PackageId>
<Version>1.2.2</Version>
<Version>1.2.3</Version>
<OutputPath>build\</OutputPath>
<SourcePath>src\</SourcePath>
<TestsPath>tests\</TestsPath>
Expand Down
44 changes: 3 additions & 41 deletions src/static/README.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
/*[[LICENSE]]*/
UPDATE:

Installation:
This project has moved to https://www.nuget.org/packages/SqlUtils.SqlDataComparison .

- Run Install.sql on your development server
- Optionally run IntallMaster.sql on your *development* server to install
thin wrapper commands in the master database which can detect the current
database (see below)

To uninstall, run `CleanMaster.sql` (only required if you previously ran
`InstallMaster.sql`), then simply delete the `SqlUtils` database to remove
everything else.

Then compare data with:

EXEC SqlUtils.CompareData '<db1>.[<schema1>].<table1>', '<db1>.[<schema2>].<table2>'

Or:

-- defaults to current database
EXEC sp_CompareData '<table1>', '<db1>.[<schema2>].<table2>'

Followed by:

EXEC [Import|Export][Added|Deleted|Changed|All] (e.g. ImportAdded) with the same arguments to transfer changes

To see what would happen without commiting to the changes use, e.g.:

BEGIN TRANSACTION
EXEC ImportAdded <args>
ROLLBACK TRANSACTION

In addition to specifying 'our' and 'their' databases as above, additional arguments include:

- @use: manually specify the columns to consider when comparing the two tables, e.g. 'col1, col2'
- @join: manually specify the column(s) on which to join our and their table, e.g. 'col1, col2'
- @map: string containing mapping between our and their columns, e.g. 'col1, map_col1; col2, map_col2'
- @ids: string containing range or set of ids to process, e.g. '1, 2, 3, 5, 9', '2-17'
- @where: detailed where condition constraining which rows to process, specify columns with 'ours' or
'theirs', e.g. 'ours.valid = 1'
- @showSql: show the generated SQL *as well as running it*; especially useful in combination with the
'ROLLBACK TRANSACTION' trick above, to be sure what will happen before committing to it
- @interleave: set to 1 to use alternative diff view, which may make it easier to see some types of changes
To update, please get the latest version of SqlUtils.SqlDataComparison from NuGet.

0 comments on commit 1348128

Please sign in to comment.