Skip to content

Instantly share code, notes, and snippets.

@mikebeaton
Created April 11, 2020 13:46
Show Gist options
  • Save mikebeaton/decac33871ad2c4737d464e272d93d4a to your computer and use it in GitHub Desktop.
Save mikebeaton/decac33871ad2c4737d464e272d93d4a to your computer and use it in GitHub Desktop.
SELECT 'OURS <<<' AS [ ],
[ours].[AddressTypeID],
[ours].[AddressType],
'THEIRS >>>' AS [ ],
[theirs].[AddressTypeID],
[theirs].[AddressType]
FROM dbo.AddressTypes [ours]
FULL OUTER JOIN RemoteServer.CustomerDatabase.dbo.AddressTypes [theirs]
ON [ours].[AddressTypeID] = [theirs].[AddressTypeID]
WHERE [ours].[AddressTypeID] IS NULL AND [theirs].[AddressTypeID] IS NOT NULL
OR [ours].[AddressTypeID] IS NOT NULL AND [theirs].[AddressTypeID] IS NULL
OR [ours].[AddressType] IS NULL AND [theirs].[AddressType] IS NOT NULL
OR [ours].[AddressType] IS NOT NULL AND [theirs].[AddressType] IS NULL
OR [ours].[AddressType] <> [theirs].[AddressType]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment